Complete the code to register an observer for the User model.
User::[1](UserObserver::class);
In Laravel, you register an observer on a model using the observe method.
Complete the observer method name to handle the event when a model is saved.
public function [1](User $user) {
// code here
}The saved method in an observer is called after a model is saved (created or updated).
Fix the error in the observer method name to correctly handle model deletion.
public function [1](User $user) {
// code here
}The deleting method is called before a model is deleted. Using delete or destroy is incorrect.
Fill both blanks to create a model observer method that runs after a model is updated.
public function [1](User $user) { // This runs [2] the model update }
The updated method runs after the model update is complete.
Fill all three blanks to define an observer method that runs before a model is created and logs the model's name.
public function [1](User $user) { Log::info('Creating user: ' . $user->[2]); // Additional code [3] }
The creating method runs before the model is created. Accessing $user->name gets the user's name. The comment placeholder is just a marker.