Actually made observer by command php artisan make:observer ProfileObserver --model=Profile
In AppServiceProvider.php:-
public function boot(Request $request) {
Profile::observe(ProfileObserver::class);
}
In ProfileObserver.php:-
public function updating(Profile $profile) {
die('here');
}
and actually i have model Profile Why observer not work ??
I solved it. first i used
Profile::where('id', $id)->update($inputs);
and that's not triggered any action. Replaced with
Profile::find($id)->update($inputs);