$ sail artisan inspire
“ It is not the man who has too little, but the man who craves more, that is poor. ”
— Seneca
This application is a starting point for building an authenticated API with the Laravel PHP framework.
- Docker Desktop
- PHP and Composer:
$ bin/install-php
- (Windows) Windows Subsystem for Linux and Ubuntu:
$ bin/install-wsl
- Clone the repository:
$ git clone https://github.com/zachwatkins/laravel-template
- Open the project directory:
$ cd laravel-template
- Run the repository initialization script:
$ bin/once
Laravel first-party packages and features:
- Breeze (Laravel Package) for user registration, login, authentication, and profile management. Also includes PHPUnit tests for authentication features.
- Sanctum (Laravel Package) for API authentication and token management.
- Sail (Laravel Package) for local development.
- Queues for performing tasks asynchronously.
- Migrations for database schema management.
- Tests for peace of mind.
My own features:
- User Storage Scope shows how to store each user's files in their own folder.
- Generic Model Class demonstrates how Laravel registers, creates, and retrieves database table records.
| Verb | URI | Action | Route Name
| GET | /
| view | welcome
| Verb | URI | Action | Route Name
| GET | /register
| create | register
| POST | /register
| store | -
| GET | /login
| create | login
| POST | /login
| store | -
| GET | /forgot-password
| create | password.request
| POST | /forgot-password
| store | password.email
| GET | /reset-password
| create | password.reset
| POST | /reset-password
| store | password.update
| Verb | URI | Action | Route Name
| GET | /verify-email
| create | verification.notice
| GET | /verify-email/{id}/{hash}
| create | verification.verify
| POST | /verify-email/{id}/{hash}
| store | -
| POST | /verify-email-notification
| store | verification.send
| GET | /confirm-password
| create | password.confirm
| POST | /confirm-password
| store | -
| PUT | /password
| update | password.update
| POST | /logout
| destroy | logout
| GET | /dashboard/
| view | dashboard
| GET | /profile
| view | profile.edit
| PATCH | /profile
| update | profile.update
| DELETE | /profile
| destroy | profile.destroy
| Verb | URI | Action | Route Name
| GET | /api/user
| closure | -
| GET | /models
| index | photos.index
| GET | /models/create
| create | photos.create
| POST | /models
| store | photos.store
| GET | /models/{id}
| show | photos.show
| GET | /models/{id}/edit
| edit | photos.edit
| PUT/PATCH | /models/{id}
| update | photos.update
| DELETE | /models/{id}
| destroy | photos.destroy
This application uses Laravel Sail for local development. Laravel Sail is a Docker-based development environment for Laravel. It provides a minimal Linux environment with all of the services and features you need to develop a Laravel application.
If you are using Windows and want to run the application locally, you will need to install Windows Subsystem for Linux.
http://localhost:80
(Web)
http://localhost:8025
(Mailpit)
(Laravel Documentation)[./docs/laravel/]