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
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
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
To install illuminate/database illuminate/events
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