encodePrimaryKey(auth()->user()->id) === request()->segment(3); } public function rules() { return [ 'name' => 'sometimes|required', 'file' => 'sometimes|nullable|max:100000|mimes:png,svg,jpeg,gif,jpg,bmp' ]; } }