Download the PHP package brilliant-portal/framework without Composer
On this page you can find all versions of the php package brilliant-portal/framework. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download brilliant-portal/framework
More information about brilliant-portal/framework
Files in brilliant-portal/framework
Package framework
Short Description BrilliantPortal is an opinionated Laravel preset.
License MIT
Homepage https://github.com/Brilliant-Portal/Framework
Informations about the package framework
[TOC]
BrilliantPortal
BrilliantPortal is an opinionated Laravel preset.
It provides starter team and user models, simplified team management, and basic API endpoints.
Out of the box, Jetstream assumes that every user will have a personal team and perhaps be invited to other teams. BrilliantPortal Framework removes the assumption that all users will have a personal team. See usage for more information.
BrilliantPortal Framework also installs a set of tests for features it provides.
PHP Support Matrix
PHP Version | Version |
---|---|
> 8.0 | 1.x.x |
7.4 | 0.1.x |
Installation
Install the package via composer with a custom repository.
- Install the app:
You can publish the config file with:
This is the contents of the published config file:
Updating
When updating BrilliantPortal Payments, you may wish to run php artisan brilliant-portal-payments:install-tests
to install any updated tests into your app.
Customization
Branding
To customize the branding, run this command and modify the new files in your application:
Views
To publish all views provided by BrilliantPortal Framework, run this command and modify the new files in your application:
BetterUptime
See https://betteruptime-laravel.brilliantpackages.com for documentation.
Usage
Permissions
Add the HasTeamPermission
middleware to routes that require a specific permission as defined in your JetstreamServiceProvider
:
Teams
Add the EnsureHasTeam
middleware to any routes that require a team. If the user does not have a team, they will be redirected to a screen prompting them to create a team.
Screenshot of creating a new team:
Screenshot of message for joining an existing team:
Users
Administrators
BrilliantPortal Framework adds an is_super_admin
column to the users
table and model. By default, it is set to false
.
Super-admins have privileges to do anything in the app, so use these permissions carefully.
The super-admin
capability can be used in authorization checks to determine if a user is a super-admin:
Add the SuperAdmin
middleware to any routes that require super-admin access. If the user is not a super-admin, they will receive a 403 Forbidden
response.
Passwords
BrilliantPortal Framework sets some default password complexity requirements. See the Laravel documentation for more information.
- Production environments: minimum 8 characters, mixed case, must not exist in known breaches
- Non-production environments: minimum 8 characters
Individual Name Fields
The \BrilliantPortal\Framework\Traits\HasIndividualNameFields
trait may be used on a User
model to indicate that the user table has distinct first_name
and last_name
fields rather than the standard name
field that Laravel provides.
Components
Several handy components are provided out of the box:
Example screenshot:
To customize these, see publishing views.
Search Engine Optimization
This package uses the Spatie Laravel Robots Middleware package to prove x-robots-tag
headers.
To use this, add the \BrilliantPortal\Framework\Http\Middleware\RobotsMiddleware
class to your app’s bootstrap/app.php
file:
You may use the SEARCH_ENGINES_SHOULD_INDEX
and/or SEARCH_ENGINES_BLOCK_PATTERNS
env variables to control access, or copy the vendor/brilliant-portal/framework/src/Http/Middleware/RobotsMiddleware.php
file into your app and tweak the logic.
API
Admin Endpoints
BrilliantPortal Framework provides endpoints for managing teams and users.
See /dashboard/api-documentation
for details.
The admin endpoints require a super-admin or these explicit permissions (to use these, add them to your app’s app/Providers/JetstreamServiceProvider.php
for the appropriate role(s)):
admin:create
admin:read
admin:update
admin:delete
Generic Endpoints
BrilliantPortal Framework provides a generic endpoint for managing any model in the app other than teams and users.
See /dashboard/api-documentation
for details.
This is intended for simple API integrations where it’s not worth the time to build a full set of endpoints and documentation. The type
URL parameter indicates which model to use.
You should create policies for each model and add them to your app/Providers/AuthServiceProvider.php
file.
For ease of use, you can extend BrilliantPortal\Framework\Policies\BasePolicy.php
and use return $this->checkTeamOwnership($user, $model, $action);
. See BrilliantPortal\Framework\User.php
for an example.
Creating New Endpoints
You should create policies for each model and add them to your app/Providers/AuthServiceProvider.php
file.
For ease of use, you can extend BrilliantPortal\Framework\Policies\BasePolicy.php
and use return $this->checkTeamOwnership($user, $model, $action);
. See BrilliantPortal\Framework\User.php
for an example.
Feel free to copy BrilliantPortal\Framework\Http\Controllers\Api\Admin\User
and use it as a starting point for your custom API controllers. This extends BrilliantPortal\Framework\Http\Controllers\Api\Controller
, which provides default authorization policy. It also provides example OpenAPI route annotations.
See brilliant-portal/framework/src/OpenApi
for example OpenAPI request, response, and schema files, and https://vyuldashev.github.io/laravel-openapi for documentation.
You may also use or extend BrilliantPortal\Framework\Http\Resources\DataWrapCollection
to wrap model index responses and BrilliantPortal\Framework\Http\Resources\JsonResource
for single model responses.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
License
The MIT License (MIT). Please see License File for more information.
All versions of framework with dependencies
illuminate/contracts Version ^11.0
laravel/framework Version ^11.0
laravel/jetstream Version ^5.1
laravel/telescope Version ^5.1
spatie/laravel-package-tools Version ^1.16
spatie/laravel-robots-middleware Version ^1.4
tartanlegrand/laravel-openapi Version ^1.13