PHP code example of firalabs / firadmin

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

    

firalabs / firadmin example snippets


Firalabs\Firadmin\FiradminServiceProvider

/*
|--------------------------------------------------------------------------
| Application IoC Container binding
|--------------------------------------------------------------------------
|*/
App::bind('Firalabs\Firadmin\Repository\UserRepositoryInterface', 'Firalabs\Firadmin\Repository\Eloquent\UserRepository'); //User model
App::bind('Firalabs\Firadmin\Repository\UserRoleRepositoryInterface', 'Firalabs\Firadmin\Repository\Eloquent\UserRoleRepository'); //User role model

'roles' => array(
	/*
	 * Grant all privileges to the administrator roles.
	 */
	'administrator'  => true,

	/*
	 * Granted basics CRUD privileges to the user administrator role on the user resource.
	 */
	'user_administrator' => array('user' => array('create', 'read', 'update', 'delete'))
)

/*
|--------------------------------------------------------------------------
| Register admin controllers
|--------------------------------------------------------------------------
*/
Route::group(array ('before' => 'auth', 'prefix' => 'admin' ), function ()
{	
	Route::get('/', 'Firalabs\Firadmin\Controllers\DashboardController@getIndex');
});

array(
	'aliases' => array(
		'AjaxRequest' => 'Firalabs\Firadmin\Facades\AjaxRequest',
		'Permissions' => 'Firalabs\Firadmin\Facades\Permissions'
	)
);

//Check permission
if(Permissions::isAllowed(Auth::user(), 'user', 'read') !== true){
	return Redirect::route('login')
		->with('reason', Lang::get('firadmin::admin.messages.insufficient-permission') . '<br>')
		->with('error', 1);
}



use Firalabs\Firadmin\Controllers\BaseController;

/**
 * Default dashboard controller
 */
class Admin_DashboardController extends BaseController {
    
	/**
	 * The current active menu URI
	 * 
	 * @var string
	 */
	public $active_menu = 'admin';

	/**
	 * Get the dashboard
	 */
	public function getIndex()
	{
		//Set layout content
		$this->layout->content = View::make('firadmin::dashboard');
	}
}
bash
php artisan config:publish firalabs/firadmin

'model' => 'Firalabs\Firadmin\Repository\Eloquent\UserRepository'
bash
php artisan auth:reminders
php artisan migrate
php artisan migrate --package="firalabs/firadmin"
bash
php artisan create:user [--role[="..."]] username email password
app/config/app.php