PHP code example of oniichann / cheap-sql-scheme

1. Go to this page and download the library: Download oniichann/cheap-sql-scheme 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/ */

    

oniichann / cheap-sql-scheme example snippets


use CheapSqlScheme\CheapSqlScheme;

// Только в локальной разработке:
CheapSqlScheme::auth(fn ($request) => app()->environment('local'));

// Только админам:
CheapSqlScheme::auth(fn ($request) => $request->user()?->is_admin);

// Через Gate:
CheapSqlScheme::auth(fn ($request) => Gate::allows('viewSqlSchemes'));
bash
php artisan vendor:publish --tag=cheap-sql-scheme-config