Giter Club home page Giter Club logo

laravel-api-only-demo's People

Contributors

s3huber avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

laravel-api-only-demo's Issues

Seed demo users

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 authentication
  • UserProfile…profile data of a user, like first name, last name, birthday, etc.
  • UserAddress…the address of the user

Initialize application

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 info endpoint

Add some kind of info endpoint to the root of the API, instead of a 404 status code.

Adapt readme

Adapt readme file accordingly, add the purpose of this repository…

How about Sanctum?

How about Laravel Sanctum?

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.

Setup cache and database

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.

  • Run migrations
  • Provide a simple status endpoint to check both

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.