Laravel Eloquent Amazing Tips and Tricks

Laravel Eloquent Amazing Tips and Tricks

Certain tasks within Laravel’s Eloquent ORM can become very repetitive and tedious within larger applications.There’s a lot of semi-hidden functions and less-known ways to achieve more with it. In this article, I will show you a few tricks. Increments and Decrements Instead of this:   $article  =  Article :: find ( $article_id ) ; $article-> read_count++ ; $article-> save ( ) ;     You can do this:   $article&