Giter VIP home page Giter VIP logo

laravel-restapi-sanctum's Introduction

REST API with Laravel using Sanctum for Auth

This repos is a simple RestFull API with Laravel using Santum for Auth.

Requirements

The requirement to test this are:

  • A Web server
  • php >= 7.0.0
  • Composer
  • A database

Setup the database

To setup the database, create a .env file at the Root of the project and copy the content of the file .env.example in that file. The following database ca be used:

  • Postgres
  • MySQL
  • SQL Server
  • MariaDB
  • Sqlite

In our case we are using sqlite and our config are the following and the database will be a file with the name database.sqlite in the folder database.

DB_CONNECTION=sqlite
DB_HOST=127.0.0.1
DB_PORT=3306

To use another database, just update this configs. The following comfig can work with MYSQL:

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=<database>
DB_USERNAME=<username>
DB_PASSWORD=<password>

Install the dependencies

Tos install the dependencies of the project run the following command at the root of the projects:

composer install

How to run

To test just clone the repo and run the migration using the following command at the root of the project.

php artisan migrate

After running The migration you can now start the web server and start to browse the endpoints.

laravel-restapi-sanctum's People

Contributors

zaker237 avatar

Watchers

 avatar

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.