Every single article I read about Eloquent usually starts with some reading operations. I don't like it. I will teach you how to create and insert new records, then we will fetch them with some reading operations.
No boring test inserts with some external administration tool.
Let's create our first book! As a reference for the record structure, we will use the
books table that we created in the previous chapter. The table has a very simple structure: a title, page count (
pages_count), price, and description.
The procedure is as easy as creating an object.
Well, actually it is exactly the same. Create a new
GET route in
routes.php file under
book_create and type ...