Eloquent

Best Way to insert Laravel Brackets to Eloquent Query (And Or Conditions)

Best Way to insert Laravel Brackets to Eloquent Query (And Or Conditions)

Laravel Brackets to Eloquent Query (And Or Conditions) This article will discuss putting brackets to And Or Conditions of laravel eloquent query. Eloquent is a great tool to interact with database via a model. Basically Laravel Models are Eloquent models and you can perform any kind of query in a simple way but sometimes it…

Laravel Database Seeders and Factories (Best Way to Seed Data)

Laravel Database Seeders and Factories

This article will focus on how you can seed the data to your database. Seeding the data means to insert some fake data or some mandatory data on the fresh migration or whatever the situation will be. Typical and most common example will be to add admin to your application to the users table.

Laravel Accessors and Mutators

Laravel Accessors and Mutators Accessors and Mutators are very useful when you are about to change some value before showing it or change the value before saving it. This article will practically demonstrate how Accessors and Mutators works. You can read more about from the Laravel Official Docs What are Accessors and Mutators. Accessors –…

Laravel Model Observers

Laravel Model Observers

Laravel Model Observers This article discuss the Laravel Model Observers. Observers help you observe any change on your Eloquent Model, for example you save a record, update a record etc. and Observer will observe that change and you can perform any action upon that change. You can read the official documentation about observers here. For…

Laravel Model Fillable vs Guarded !

Laravel Model Fillable vs Guarded !

Laravel Model Fillable vs Guarded Attributes Fillable and Guarded arrays works the same but are the opposite of each other and this article will discuss exactly what is fillable and guarded. There are three methods to save, update records in Laravel. For example we have a table employees having two fields employee_name and employee_email. In…