diff --git a/app/Http/Controllers/Usercontroller.php b/app/Http/Controllers/Usercontroller.php index 6d35cde..749d1cd 100644 --- a/app/Http/Controllers/Usercontroller.php +++ b/app/Http/Controllers/Usercontroller.php @@ -29,9 +29,10 @@ class UserController extends Controller return redirect()->route('users.index'); } - public function index(UsersDataTable $dataTables) + public function index() { - return $dataTables->render('users.index'); + $users = User::latest()->get(); + return view('users.index', compact('users')); } public function destroy(string $id) diff --git a/app/View/Components/application-logo.php b/app/View/Components/application-logo.php deleted file mode 100644 index fa70ace..0000000 --- a/app/View/Components/application-logo.php +++ /dev/null @@ -1,26 +0,0 @@ - +
+

Create User

+
+
+
+
Add New User
+ Back +
+ +
+
+
+ @csrf +
+
+
+ + +
+
+
+ +
+
+
+ + +
+
+
+ +
+
+
+ + +
+
+
+ +
+
+
+ + +
+
+
+ +
+
+ +
+
+
+
+
+
+ +@endsection diff --git a/resources/views/users/index.blade.php b/resources/views/users/index.blade.php new file mode 100644 index 0000000..df05f2d --- /dev/null +++ b/resources/views/users/index.blade.php @@ -0,0 +1,55 @@ +@extends('layouts.app') +@section('content') +
+
+

List users

+
+
+
+ @can('create users') + New User + @endcan +
+ +
+
+ + + + + + + + + + @can('access users') + @foreach ($users as $permission) + + + + + + @endforeach + @endcan + +
S.NNameAction
{{ $permission->id }}{{ $permission->name }} + @can('edit users') + + @endcan + @can('delete users') +
+ @csrf + @method('delete') + +
+ @endcan +
+
+
+
+
+@endsection diff --git a/routes/web.php b/routes/web.php index b6eb592..5278a05 100644 --- a/routes/web.php +++ b/routes/web.php @@ -2,6 +2,7 @@ use App\Http\Controllers\PermissionController; use App\Http\Controllers\RoleController; +use App\Http\Controllers\UserController; use Illuminate\Support\Facades\Route; /* @@ -25,3 +26,4 @@ Route::get('/dashboard', [App\Http\Controllers\HomeController::class, 'index'])- Route::resource('roles', RoleController::class)->names('roles'); Route::resource('permissions', PermissionController::class)->names('permissions'); +Route::resource('users', UserController::class)->names('users');