php tutorial - Using illuminate/database, eloquent model and composer outside laravel

php tutorial – Using illuminate/database, eloquent model and composer outside laravel



In this video, I have shown how can we use illuminate/database package outside laravel mvc framework. How can we extend the eloquent model. How can we use composer for autoloading php file. All source code will be available in following link

making a website with illuminate database package outside laravel
visit package on page

installing illuminate/database package with dependancy
composer require illuminate/database illuminate/events

adding db.php file to composer.json file to autolaod and doing composer dump-autoload command
“autoload”: {
“files”: [“db.php”]
}
creating table using schema builder
Relation between 2 models is, subject belongs to Department and Department has many subjects.

adding model folder to composer.json file to autolaod all models and doing composer dump-autoload command
“autoload”: {
“classmap”: [“Models”]
}
How to run this source code in your pc
I hope you already have npm(node package manager) and composer install in your pc. If its not your case just download node js from and download composer from

Once you have installed both software in your pc you just do following command in terminal.

To install jquery, bootstrap, popper.js

npm install
To install illuminate/database illuminate/events

composer install
Login to your mysql account and make a database name college

Now serve using any server. You can use php mini server like mine.

php -S localhost:8000
Here 8000 could be any 4 digit

7 thoughts on “php tutorial – Using illuminate/database, eloquent model and composer outside laravel

  1. Спасибо большое. Доступно и понятно объяснил

  2. Amazingly good tutorial. Very well explained in a sweet voice. Thanks a lot. Subscribed already, will be waiting for any tutorial on PHP/Laravel?Vuejs from your channel. Regarsd.

  3. A thousand thank you's! I hope one day you will make more tutorials, you are an amazing teacher. Simple, effective with real world results, perfect.

Leave a Reply

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