Support the ongoing development of Laravel.io →
Database Eloquent Laravel

I first needed this information while working on a large projects with no tests/factories, and so many migrations, so it was distracting to look for each required fields in manual approach.

I created a simple trait to fetch required fields. It was easy in Laravel 11 and 10. Then I realize that the most programmers who face this problem are usually in older versions, so I added support for laravel 9,8,7,6 and make extract the logic into package.

I tested the code for each laravel verions supported and each SQL databases: SQLite, MySQL, MariaDB, PostgreSQL, and Microsoft SQL SERVER. I needed to add support for each SQL database because I used DB Facade with raw SQL query and in every time there were a slice deffent.

The package is fully tested with PHPUnit and GitHub Action for every laravel verison and for each database.

I hope you like this package and I welcome any contribution or comment.

https://github.com/watheqAlshowaiter/model-required-fields

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.