s3bsch / laravel-api-only-demo Goto Github PK
View Code? Open in Web Editor NEWLaravel API only demo application.
License: MIT License
Laravel API only demo application.
License: MIT License
Seed some demo users in order to be able to provide some API endpoints regarding users later on.
For the purpose of the demo, a user should be split into several models/tables:
User
…the very basic information regarding a user, needed for authenticationUserProfile
…profile data of a user, like first name, last name, birthday, etc.UserAddress
…the address of the userEnable tests to be automatically run via Github Actions on every push.
Initialize Laravel application in a state-of-the-art way.
I currently have no local PHP installed, just working with Docker containers in my work related projects. I like this approach very much and want to try to keep it this way.
Add some kind of info endpoint to the root of the API, instead of a 404
status code.
Remove all unnecessary stuff according to the tweet of Taylor Otwell and maybe more.
Provide Postman collection for API of this application.
Adapt exception handler to always return JSON.
Adapt readme file accordingly, add the purpose of this repository…
Is it the default authentication mechanism in a Laravel v9 application?
Laravel Sanctum is shipped by default with Laravel v9. I think this was started with v8, but found no reference quickly.
What have to be changed to use Sanctum as intended for API only application?
By default Laravel Sanctum supports two different mechanisms to authenticate the current user/client. For SPAs a cookie based approach is suggested, which also prevents CSRF attacks. But there is also a second approach, which works with classic API bearer tokens. 1
For this demo application, I would like to adapt Laravel Sanctum in such a way, that it only works with API token based authentication. I'll try to disable and remove the whole cookie stuff.
Anything else to know about Sanctum?
Laravel Sanctum could/should be used in combination with Laravel Jetstream or Laravel Breeze.
Adapt the .env.example
file to contain only the variables needed to run this application.
Setup a cache and database driver.
As database let's try to use SQLite as this should be good enough and I have never used it before.
Add according open-source license.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.