The Eloquent Model can actually do tons of things in a very smart and easy way. However, something can be improved in terms of code to write every time you want to do a specific operation.
Usually, when creating a new model instance, you are probably using some data that the user previously typed in to a form.
Adding a new author to our database can be the perfect example. All you have to do is to insert the first and last names in to a form and then press save.
Then, in the dedicated post route (or relative controller method), you will do something similar to the following:
<?php public function postAdd(Request $request) { $author = new Author; $author->first_name = $request->input('first_name'); $author->last_name = $request->input('last_name'); $author->save(); }
That's quite fine. However, you will probably also have to validate the user input.
So, assuming that you are still in a controller, you could add a controller validator...