This is a simple example of how Laravel and Yajra's Laravel DataTables might get integrated. Primitive approach, but enlightening.
- PHP 8.1
- NodeJS 16
- MySQL 5.7
Simple winget-install.bat script added (experimental)
for you to easily set up this project
Just remember to add path to your PHP script (C:\xampp\php) to your Environment Variable called "Path"
Once you have all the dependencies installed:
Composer might complain about ext-gd extension. To enable it, go to C:\xampp\php and edit php.ini file
by uncommenting (remving ";" - semicolon) line like: ;extension=gd
Please install both frontend and backend libraries:
composer install;
npm install;Ensure migration is performed. Create new database, fill
values in .env file (with database name and host set).
Then run php artisan migrate
Run php artisan tinker and type:
Product::factory()->count(25)->create();It should fill your database with fake data on Products.
Please check it with phpMyAdmin or inside php artisan tinker
Product::where([])->get();Should return a list of 25 items
Now you can start server. Firstly build assets with
npm run devThen run server with
php artisan serveGo to localhost:8000 and follow links