Projects

All snippet related to projects

 

Adding boostrap and auth scaffolding using laravel/ui package

To properly install auth scaffolding and use bootstrap together in laravel we need to run following commandscomposer require laravel/uiphp artisan...


Setting up login page in home route

Step 01: Setting up routes/web.php Route::get('/', [LoginController::class,'login']); Step 02: Changing Up Auth/LoginController.php public function login() {    return view( 'auth.login' );...


Redirecting to product list or order list page after login based on role

For this project we consider two types of user - admin and customer. Their roles are assigned as 1 and...


Adding all menus with their matching routes

From previous post now its time to add menus in our layout. But before that we need to create Profile...


Protecting all menus based on admin or customer role

Step 01: Changing in app.blade.php like following @if(auth()->user()->role_id == 1) {{ __('Users') }} {{ __('Products') }} {{ __('Profile') }} {{...


Listing rows of users - crud

Step 01: Adding jQuery with npm npm i jquery Step 02: Using bootstrap 5 icons //Installing bootstrap 5 icons with...


Adding user data - crud of users

Step 01: Adding user add button just above of table element in list of users All Users Add User Step...


Editing user data - crud of users

Step 01: In UserController, adding edit() method  public function edit( User $user ) { $meta_title = 'Edit User ' ....


Deleting user data - crud of users

Step 01: In UserController, adding destroy() method public function destroy( User $user ) { $user->delete(); return redirect()->route( 'users.index' )->with( 'success',...


Searching user data - crud of users

Step 01: Adding search form just above table element in list.blade.php under resources/view/users All Users Add User Step 02: Then,...