method() == 'DELETE' || ($this->has('nodata'))) { return [ 'id' => $id_rules, ]; } return [ 'id' => [Rule::when($this->method() == 'PUT', $id_rules)], 'name' => ['required', 'string'], 'url' => ['required', 'string'], 'icon' => ['required', 'string'], ]; } /** * Determine if the user is authorized to make this request. * * @return bool */ public function authorize() { return true; } }