Giter VIP home page Giter VIP logo

lara-plate's Introduction

lara-plate

lara-plate is a laravel boilerplate based on l5-repository which using repositories pattern as an abstraction to the database layer, for further information you might check http://andersao.github.io/l5-repository.

If you want to know a little more about the Repository pattern you might read this great article.

There's also a postman collection you might want to take a look at here.

Table of Contents

Laravel

This repository built on laravel 6.x version. For further information you might read the laravel 6.x documentation https://laravel.com/docs/6.x.

Installation

You might download the repository as a zip or clone the repository using git clone command via https.

git clone https://github.com/latuconsinafr/lara-plate.git

Then move to the directory,

cd lara-plate

Install all the dependencies,

composer install

Copy the .env,

cp .env.example .env

Then set the configuration all of the .env variables as you want to.

Generate the jwt secret key

php artisan jwt:secret

Eventually, all set, you're ready to go.

Authentication

This repository currently applied json web token authentication for laravel & lumen by tymon, you can find the repository here or the complete docs here.

The basic authentication is already registered in routes/api.php which correspond to AuthenticationController with 3 main endpoints:

  • /login to handle user log-in
  • /logout to handle user log-out and invalidate the active token
  • /register to handle user registration with auto_login option available via query params auto_login

The authentication guard itself currently applied to /users endpoint using auth.jwt middleware inside routes/api.php as it shown below.

/* With Auth */
Route::group(['middleware' => 'auth.jwt'], function () {
    Route::resource('users', UsersController::class);
});

Helpers

This repository currently applied helper with the help of helpers package by brown, you can find the repository here.

The application is already provided with a helper called GlobalVariableHelper in app/Helpers. This helper would help you to call a specified variable across the application. For example, to simply get a list of roles used in the application, you can call the getApplicationRoles() function anywhere.

/* Define roles */
$roles = getApplicationRoles();

Authorization

Authorization which is related to roles and permissions is currently provided built-in with the help of a spatie package called laravel-permission, you can find the repository here. All settings and configurations are default, following the docs here.

By default the authorization is currently applied in UsersController using middleware as it shown below.

/* Permission middleware */
$this->middleware('permission:' . getApplicationPermission('super-admin')) // By default super-admin can do literally anything
    ->only([
        'index',
        'store',
        'show',
        'edit',
        'update',
        'destroy'
    ]);

Others

License

The lara-plate boilerplate is open-sourced boilerplate licensed based on Laravel software, under the MIT license.

lara-plate's People

Contributors

dependabot[bot] avatar latuconsinafr avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

refferaldev

lara-plate's Issues

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.