Now Available : Learning Laravel’s Eloquent

This January, I filled a list with some good intentions for this new year. Not a big list, just five points.

One of these points was “to write a book“. I already had some plans for it: about Laravel, of course. Then, a couple of weeks later, I received an email from Rebecca Youe, from Packt Publishing.

A very clear message that was basically saying: “would you like to write a book about Laravel, for Packt?

I was stunned. Obviously, I accepted. I started in February, following a well defined process and schedule. An awesome experience, because it was my first time getting involved in book writing: I learned many things about planning a book and structuring its chapters. It’s very similar to the software development process: the starting analysis step is vital.

However today this book is finally available.

B03634_MockupCover_Normal

Learning Laravel’s Eloquent is a book totally focused on Eloquent, the Laravel ORM (Object Relational Mapper). In this book I tried to put everything I know, starting from the very basics (setting up a project, using some useful tools) to a couple of advanced topics. As I also wrote on the Packt Website, here’s what the book features:

  • Configure a new Laravel project and set up database connections in minutes
  • Build and work with models to handle your data with an expressive syntax
  • Define relations between your models to create complex functionalities
  • Query your database using relations simply
  • Use collections to gather results and perform many operations on them with a powerful data structure
  • Use the Eloquent ORM without Laravel
  • Control your models during the request lifecycle with event listeners and observers

Hope you will like it 🙂

You can buy it here on Packt Website.

Oh, and it’s not ending here…

  • Vytautas@

    Buon Giorno Francesco!
    I’d like to thank you for your book, it’s really useful and I learned a lot only reading first chapter. Tho I’d like to ask you about pivots, it’s not clear if for example you created migration book_category pivot table, but there is no foreign keys attached, something like this

    
    public function up()
    {
            Schema::create('book_category', function (Blueprint $table) {
                $table->increments('id');
                $table->integer('book_id')->unsigned();
    $table->foreign('book_id')->references('id')->on('books');
                $table->integer('category_id')->unsigned();
    $table->foreign('category_id')->references('id')->on('category');
                $table->text('notes');
                $table->timestamps();
            });
        }
    

    I’m stuck on this one. Maybe you have some code to share how it’s done?
    I’m building classified site with lots of categories involved, so this part is crucial for me 🙂
    Thanks.