1- ## DataTables Quick Starter
1+ # DataTables Quick Starter
22
3- ### Create a new Laravel project
3+ ## Create a new Laravel project
44
55```
66laravel new datatables
77cd datatables
88```
99
10- ### Setup Laravel UI
10+ ## Setup Laravel UI
1111
1212``` shell
1313composer require laravel/ui --dev
1414php artisan ui bootstrap --auth
1515```
1616
17- ### Install Laravel DataTables
17+ ## Install Laravel DataTables
1818
1919``` shell
2020composer require yajra/laravel-datatables:^9.0
2121```
2222
23- ### Setup database and ENV configuration
23+ ## Setup database and ENV configuration
2424
2525Create a new database and update ` .env ` file and set the database credentials.
2626
@@ -37,7 +37,7 @@ DB_DATABASE=/absolute/path/to/database/database.sqlite
3737php artisan migrate
3838```
3939
40- ### Install Laravel DataTables Vite Assets
40+ ## Install Laravel DataTables Vite Assets
4141
4242``` shell
4343npm i laravel-datatables-vite --save-dev
@@ -49,7 +49,7 @@ This will install the following packages:
49492 . DataTables with Buttons and Select plugins for Bootstrap 5
50503 . Laravel DataTables custom scripts
5151
52- ### Register the package js and css
52+ ## Register the package js and css
5353
5454Edit ` resources/js/app.js ` and add the following:
5555
@@ -77,13 +77,13 @@ Edit `resources/sass/app.scss` and add the following:
7777@import 'datatables.net-select-bs5/css/select.bootstrap5.css';
7878```
7979
80- ### Compile the assets
80+ ## Compile the assets
8181
8282```
8383npm run dev
8484```
8585
86- ### Create and update UsersDataTable
86+ ## Create and update UsersDataTable
8787
8888Create a new DataTable class:
8989
@@ -153,7 +153,7 @@ class UsersDataTable extends DataTable
153153}
154154```
155155
156- ### Create and update the users controller
156+ ## Create and update the users controller
157157
158158Create a new controller and add the following:
159159
@@ -175,7 +175,7 @@ class UsersController extends Controller
175175}
176176```
177177
178- ### Update the default app layout
178+ ## Update the default app layout
179179
180180Add ` @stack('scripts') ` before the body end tag of ` resources/views/layouts/app.blade.php `
181181
@@ -190,7 +190,7 @@ Add `@stack('scripts')` before the body end tag of `resources/views/layouts/app.
190190</html>
191191```
192192
193- ### Create users index file
193+ ## Create users index file
194194
195195Create new file: ` resources/views/users/index.blade.php ` .
196196
@@ -213,7 +213,7 @@ Create new file: `resources/views/users/index.blade.php`.
213213@endpush
214214```
215215
216- ### Register users route
216+ ## Register users route
217217
218218Update ` routes/web.php ` .
219219
@@ -223,7 +223,7 @@ use App\Http\Controllers\UsersController;
223223Route::get('/users', [UsersController::class, 'index'])->name('users.index');
224224```
225225
226- ### Create dummy data using tinker
226+ ## Create dummy data using tinker
227227
228228``` php
229229php artisan tinker
@@ -232,7 +232,7 @@ Psy Shell v0.9.9 (PHP 7.2.22 — cli) by Justin Hileman
232232>>> User::factory(100)->create()
233233```
234234
235- ### Access Users DataTables
235+ ## Access Users DataTables
236236
237237http://datatables.test/users
238238
0 commit comments