/laravel-datatable

The repository contain laravel framework with integrated datatable ( yajra-datatable ) & it uses database custom seeder to seed/insert data into table. i have used a custom database seeder (UserSeeder) to seed data into user table & i have also used faker library for seeding fake data in table. This is just a basic example how you can use yajara-datatable & You can create Your own table seeder to insert fake/dummy data in table.

Primary LanguagePHP

Laravel yajra datatable installation

https://github.com/yajra/laravel-datatables { This for installation }

https://datatables.yajrabox.com/starter { This for controller setup & css & js file }

Laravel css & js assets for blade template

Datatable Method

<script src="//code.jquery.com/jquery.js"></script> <script src="//cdn.datatables.net/1.10.7/js/jquery.dataTables.min.js"></script> <script src="//netdna.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>

Laravel controller

use Yajra\Datatables\Datatables;

Laravel controller method

Datatable Method

Laravel collective installation

https://laravelcollective.com/docs/6.0/html#installation

Laravel faker library

https://github.com/fzaninotto/Faker

I have user custom seeder (UserSeeder) to insert/seed data into database.

Laravel seeder command

https://laravel.com/docs/7.x/seeding php artisan db:seed ( default command execute DatabaseSeeder )

php artisan db:seed --class=UserSeeder ( command execute UserSeeder )

Laravel Added Cron/command Function (Laravel Cronjob Scheduling Example)

Referense : https://appdividend.com/2018/03/01/laravel-cronjob-scheduling-tutorial/

Laravel api module & Soft Delete method

Reference : https://medium.com/@chrissoemma/laravel-5-8-delete-and-soft-delete-practical-examples-b9b71c0a97f

Api Endpoints postman : [POST] http://localhost/blog/api/v1/notes [GET] http://localhost/blog/api/v1/notes [DELETE] http://localhost/blog/api/v1/notes/4 [DELETE] http://localhost/blog/api/v2/notes/2 [GET] http://localhost/blog/api/v2/notes/withsoftdelete [GET] http://localhost/blog/api/v2/notes/softdeleted [PATCH] http://localhost/blog/api/v1/notes/3 [DELETE] http://localhost/blog/api/v3/notes/2

Creating new migration for alteration of table : php artisan make:migration add_votes_to_users_table --table=users