1. Go to this page and download the library: Download brilliant-portal/framework 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/ */
brilliant-portal / framework example snippets
return [
'api' => [
'version' => env('BPORTAL_FRAMEWORK_API_VERSION', 'v1'), // API versioning.
],
'telescope' => [
'prune' => [
'hours' => env('TELESCOPE_PRUNE_HOURS', 48), // Prune entries older than this many hours.
],
],
];
# Routes file in your app.
use BrilliantPortal\Framework\Http\Middleware\HasTeamPermission;
Route::middleware(['auth:sanctum', HasTeamPermission::class.':create'])
->post(/* any endpoint where the user must have the `create` permission on their current team */);
# Routes file in your app.
use BrilliantPortal\Framework\Http\Middleware\EnsureHasTeam;
Route::middleware(['auth:sanctum', EnsureHasTeam::class])
->get('/team/settings/', function () {
//
});
if (Auth::user()->can('super-admin')) {
// User is super-admin.
}
# Routes file in your app.
use BrilliantPortal\Framework\Http\Middleware\SuperAdmin;
# Using class name
Route::middleware(['auth:sanctum', SuperAdmin::class])
->get('/admin/dashboard/', function () {
//
});
# Using ability
Route::middleware(['auth:sanctum', 'can:super-admin'])
->get('/admin/dashboard/', function () {
//
});
// Pills (as a view).
return view('brilliant-portal-framework::components.pills.active', ['slot' => $value]);