![]() If (isset( static:: $modelEventsToRecord)) _". * * */ protected static function getModelEventsToRecord() ![]() ** * Get the model events that should trigger activity recording. ** * Get the subject for the activity recording * * $this */ protected function activitySubject() Return $ this-> hasMany( Activity::class) * * $description */ public function recordActivity( $description) $model-> formatActivityDescription( $event) Install Tailwind via npm npm install tailwindcss -save-dev 2. $this->project()->update($this->validated()) // $project = $this->project() // $project->update($this->validated()) // return $project return tap( $ this-> project())-> update( $ this-> validated()) Īpp\Http\Controllers\ProjectsController.php We'll begin by pulling in all necessary npm dependencies and configuring Tailwind compilation with Laravel Mix. ![]() because if in the parameters has `Project $project`, // `Project::findOrFail($this->route('project'))` will return array // if not, `$this->route('project')` will be "1" (the id of table projects) // and `Project::findOrFail($this->route('project'))` will be an object of database collection return Project:: findOrFail( $ this-> route( 'project')) return $this->route('project') // dd(Project::findOrFail($this->route('project'))) // dd($this->route('project')) // use this `Project::findOrFail($this->route('project'))` will cann't use `public function update(UpdateProjectRequest $request, Project $project)` in controller, if, 403 will response. ** * Get the validation rules that apply to the request. Route('project')) return Gate:: allows( 'update', $ this-> project()) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |