How to build a Blog system with Laravel | Part 2

In the previous tutorial, we created all the migrations files and the corresponding model that respect our UML design. In this tutorial, we’ll only work on models by adding fillable and Eloquent relationships.

The fillable attributes are the fields of the table that can be filled from an array to directly create a new record in our database. Eloquent relationships are defined as methods in our Eloquent model classes that serve as powerful query builders mechanisms.

To have an explanation about Eloquent Relationship, hit the documentation so you will easily the following content.

Post class

BlogCategory class

Users class

Image class

Comment class

I really advise you to read the documentation relating to the Eloquent relationship, it’s a lifesaver concept while working with Laravel. Also, the complete source is available. You can choose to learn from the code itself.

If development isn’t your field, consider hiring Laravel specialists who can supercharge your application’s scalability and performance with precision.

DERICK TEMFACK

<span class="router-outlet-wrapper ng-tns-c950005113-0"><span class="ng-star-inserted">Hi, I'm Derick. I am a Software Engineer and DevOps pro. I specialize in turning complex business needs into </span><span class="ng-star-inserted">automated workflows</span><span class="ng-star-inserted"> using Python, Odoo, and Go. I write </span><span class="ng-star-inserted">engineering case studies</span><span class="ng-star-inserted"> here—sharing the architectural decisions and real-world code behind the solutions I build.</span></span>

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top