Setup Laravel
Installing Laravel
- Install composer
- Type in cmd ” composer create-project laravel/laravel app_name “
- Go to app_name folder and type ” php artisan serve “
- Change DB name in .env file
- Open cmd and type the following commands
Laravel Admin and User Login & Registration
- composer require laravel/jetstream
- php artisan jetstream:install livewire
- npm install // nodejs is important
- npm run dev
- Changes in User Table > Go to database folder > migration folder > edit in users_table
-
$table->string(‘usertype’)->default(0); // default 0 means regular user, 1 means admin user$table->string(‘phone’)->nullable();$table->string(‘address’)->nullable(0);
6.php artisan migrate
***NOTE*** If you get error like failed to connection :
- Run php artisan serve
***NOTE*** If login or registration page css not loading in laravel use the following
- composer require laravel/ui
- php artisan ui bootstrap –auth
- npm install
- npm run dev
- npm run production