Highly scalable, mobile-friendly Laravel platform with authentication, RESTful API, Metronic theme integration, Livewire, comprehensive tests, and more.
cd kanye-quotes
composer install
alias sail='[ -f sail ] && sh sail || sh vendor/bin/sail'
cp .env.example .env
npm install && npm run build
sail up -d
alias for sail may be globally exported once -d flag for background running
Note: Docker image must be already running to apply migrations
alias sail='[ -f sail ] && sh sail || sh vendor/bin/sail'
sail artisan migrate:refresh --seed
Congrats! 🎉
App running on: http://localhost:80
Login using demo:password
or sign up
- Swagger route: http://localhost:80/api/documentation
- Endpoint
http://localhost/api/kanye/quote
- Endpoints
http://localhost/api/kanye/quotes/5
RESTFul Endpoints required a valid user token passed withing header
'Authorization': 'Bearer ' + YOUR_API_TOKEN_HER
'Accept': 'application/json'
- Derive auth token for user
sail artisan tinker
$user = App\Models\User::first();
$token = $user->createToken('demo')->plainTextToken;
- Then send curl with auth successful
curl -H "Authorization: Bearer YOUR_API_TOKEN_HERE" -H "Accept: application/json" http://localhost/api/kanye/quote
You should see a quote :)
TODO: Create test .env.testing and test_database for tests phpunit.xml
sail artisan test // all tests
sail artisan test --testsuite=Feature // Feature tests
sail artisan test --testsuite=Unit // Unit tests
sail artisan test --testsuite=Api // Api tests
- Docker 4+
- Composer 2+
- PHP 8+
Might contain some components from mine previous projects to save time