The Blog

My Toughts

Search on Eloquent Relationships

Search on Eloquent Relationships

Mostly we use filters and scopes directly on our eloquent model. Also, it’s possible we want to return a dataset based on the relationships connected our model. In this post, we want to review a basic concept of “nested” search on eloquent relationships.   The Basic Concept...

Read More

Handy Laravel Tips

Handy Laravel Tips

Laravel has a lot of handy features what hidden in the documentation or not documented at all. We collected a few features what helped our work, but not everyone knows them. @auth – @guest Almost every web app has to authenticate users. Also, we want to show/hide things based on the user&r...

Read More

Route Model Binding in Laravel

Route Model Binding in Laravel

Working with a lot of endpoints and controllers, it’s nice to keep them clean as much as possible. Little solutions like Laravel’s route model binding helps us to keep our controllers cleaner. Without Binding Without the route model binding, generally our controller show method would l...

Read More

Keep the Code Clean with Laravel Events

Keep the Code Clean with Laravel Events

In many cases, when our application becomes bigger, and it needs to handle more and more tasks, the size of our controllers, presenters or services can be increased fast, and easily becomes hard to work with, untestable and slow. Simplicity in charge Reorganizing our logic, and placing a di...

Read More

Laravel Mutators

Laravel Mutators

Laravel accessors and mutators are custom, user defined methods that allow you to format Eloquent attributes. Mutators format the attributes before saving them to the database. Syntax for defining a mutator function is setFooAttribute()  where Foo is a camel...

Read More