Laravel & Angular authentication Medium article resources
- Clone this repository
- Install laravel project dependencies
cd medium-laravel-angular-back
composer install
- Install angular project dependencies
cd medium-laravel-angular-front
npm install
- Create an
.env
file and configure your database access - Migrate and configure laravel/passport
cd medium-laravel-angular-back
php artisan migrate
php artisan passport:install
- Configure laravel/passport on Angular
Get the password grant client token generated by the above command (php artisan passport:install) and update the file
laravel-angular-auth-front/src/app/services/auth.service.ts
by editing the login() method
- Add sample user
cd medium-laravel-angular-back
php artisan db:seed
This command will add a sample user with the following information to your database:
- Name: John DOE
- Email: john.doe@email.com
- Password: secret
- Run application Run laravel application, by executing the following command:
cd medium-laravel-angular-back
php artisan serve
Run angular application, by executing the following command:
cd medium-laravel-angular-front
ng serve
PS. Use the sample user email and password in the authentication form.