PHP code example of leszcz / laravel-directadmin

1. Go to this page and download the library: Download leszcz/laravel-directadmin 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/ */

    

leszcz / laravel-directadmin example snippets


// config/app.php
'providers' => [
    ...
    Solitweb\LaravelDirectAdmin\LaravelDirectAdminServiceProvider::class,
];

// config/app.php
'aliases' => [
    ...
    'DirectAdmin' => Solitweb\LaravelDirectAdmin\LaravelDirectAdminFacade::class,
];

use DirectAdmin;

return DirectAdmin::get()->request('SHOW_USERS');

return DirectAdmin::get()->request('SHOW_USER_USAGE', ['user' => 'john']);

$users = DirectAdmin::getShowAllUsers();
// Translates to DirectAdmin->get()->request('SHOW_ALL_USERS');

return DirectAdmin::postAccountAdmin([
    'action' => 'create',
    'username' => 'New Admin',
    ....
]);
// Translates to DirectAdmin->post()->request('ACCOUNT_ADMIN', [arguments]);
bash
php artisan vendor:publish --provider="Solitweb\LaravelDirectAdmin\LaravelDirectAdminServiceProvider"