PHP code example of desino / boilerplate

1. Go to this page and download the library: Download desino/boilerplate library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

desino / boilerplate example snippets


App\Providers\BladeDefaultVariablesServiceProvider::class,

use Illuminate\Foundation\Configuration\Middleware;

->withMiddleware(function (Middleware $middleware) {
    //
})

->withMiddleware(function (Middleware $middleware) {
    $middleware->web(append: [
        \App\Http\Middleware\CheckUserIsActive::class,
    ]);

    $middleware->alias([
        'checkIfAdmin' => \App\Http\Middleware\CheckUserIsAdmin::class,
    ]);
})

return Application::configure(basePath: dirname(__DIR__))
    ->withRouting(
        web: __DIR__.'/../routes/web.php',
        commands: __DIR__.'/../routes/console.php',
        health: '/up',
    )
    ->withMiddleware(function (Middleware $middleware) {
        $middleware->web(append: [
            \App\Http\Middleware\CheckUserIsActive::class,
        ]);

        $middleware->alias([
            'checkIfAdmin' => \App\Http\Middleware\CheckUserIsAdmin::class,
        ]);
    })
    ->withExceptions(function (Exceptions $exceptions) {
        //
    })
    ->create();

Route::middleware(['auth', 'checkIfAdmin'])->group(function () {
    // users, appconfig, ...
});

'checkIfAdmin' => \App\Http\Middleware\CheckUserIsAdmin::class,

\App\Http\Middleware\CheckUserIsActive::class,

'myapp_force_https' => env('MYAPP_FORCE_HTTPS', false),
bash
php artisan make:desino-boilerplate
bash
php artisan migrate
bash
php artisan optimize:clear
bash
php artisan db:seed --class=DesinoBoilerplateSeeder