Skip to content

Commit

Permalink
update dataTable
Browse files Browse the repository at this point in the history
  • Loading branch information
Abu-Salah-Musha-Lemon committed Sep 24, 2024
1 parent 10911e9 commit db14597
Show file tree
Hide file tree
Showing 29 changed files with 369 additions and 172 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,16 @@ php artisan key:generate<br>
php artisan config:cach<br>
php.ini/extension=zip<br>
npm install<br>
npm run dev
npm run dev <br>

#### pagination system :
#### if you need the pagination system please go ->Providers/AppServiceProvider and
use Illuminate\Pagination\Paginator;
public function boot(): void
{
Paginator::useBootstrap();
}
past the code

12 changes: 10 additions & 2 deletions app/Http/Controllers/Auth/AuthenticatedSessionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,20 @@ public function create(): View
public function store(LoginRequest $request): RedirectResponse
{
$request->authenticate();

$request->session()->regenerate();

// Check user role and redirect accordingly
if (Auth::user()->roles->contains('name', 'admin')) {

return redirect()->intended(route('adminDashboard', absolute: false));
} else {
return redirect()->intended(route('userProfile', absolute: false));

return redirect()->intended(route('dashboard', absolute: false));
}
}


/**
* Destroy an authenticated session.
*/
Expand Down
16 changes: 5 additions & 11 deletions app/Models/User.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laratrust\Traits\HasRolesAndPermissions;

use Laratrust\Contracts\LaratrustUser;

class User extends Authenticatable implements LaratrustUser
Expand All @@ -19,18 +17,14 @@ class User extends Authenticatable implements LaratrustUser
'password',
];


protected $hidden = [
'password',
'remember_token',
];


protected function casts(): array
{
return [
'email_verified_at' => 'datetime',
'password' => 'hashed',
];
}
protected $casts = [
'email_verified_at' => 'datetime',
'password' => 'hashed',
];

}
3 changes: 2 additions & 1 deletion app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Providers;

use Illuminate\Pagination\Paginator;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
Expand All @@ -19,6 +20,6 @@ public function register(): void
*/
public function boot(): void
{
//
Paginator::useBootstrap();
}
}
5 changes: 5 additions & 0 deletions public/dataTable/bootstrap-icons.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions public/dataTable/buttons.dataTables.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions public/dataTable/buttons.html5.min.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions public/dataTable/buttons.print.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Loading

0 comments on commit db14597

Please sign in to comment.