PHP code example of rwbuild / dashboard
1. Go to this page and download the library: Download rwbuild/dashboard 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/ */
rwbuild / dashboard example snippets
...
/*
|--------------------------------------------------------------------------
| Dashboard Routes
|--------------------------------------------------------------------------
*/
Route::group(['namespace' => 'Dashboard', 'prefix' => 'dashboard'], function () {
...
});
use App\Http\View\Composers\Dashboard\ {
TosComposer,
HomeComposer,
UsersComposer,
RolesComposer,
ReportsComposer,
PermissionsComposer
};
...
public function boot()
{
View::composer('dashboard::assets.home', HomeComposer::class);
View::composer('dashboard::assets.users', UsersComposer::class);
View::composer('dashboard::assets.roles', RolesComposer::class);
View::composer('dashboard::assets.permissions', PermissionsComposer::class);
View::composer('dashboard::assets.tos', TosComposer::class);
View::composer('dashboard::assets.reports', ReportsComposer::class);
}
...
"files": [
"app/Helpers/DashboardHelpers.php"
]
...
Then run composer dump-autoload
...
'visit.log' => \Dashboard\Http\Middlewares\LogVisit::class
...
use Dashboard\Facades\Model;
...
public function index()
{
return Model::user()::all();
}
...
...
use ModelsDefinition;
public function show()
{
return $this->user::findOrFail(1);
}
...
php artisan dashboard:setup
php artisan migrate
php artisan dashboard:install
php artisan migrate