The Blog

My Toughts

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

Laravel Accessors

Laravel Accessors

Defining an accessor Syntax for defining an accessor is getFooAttribute() where Foo is capitalized attribute you want to access. If your attribute is first_name, and you want to be sure that first name will always be camel cased when you fetch it, you’ll need to define an acces...

Read More