Download the PHP package cswni/filament-companies without Composer
On this page you can find all versions of the php package cswni/filament-companies. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cswni/filament-companies
More information about cswni/filament-companies
Files in cswni/filament-companies
Package filament-companies
Short Description A Laravel Authentication System based on Companies built using Filament
License MIT
Homepage https://github.com/andrewdwallo/filament-companies
Informations about the package filament-companies
Filament Companies
A Complete Authentication System Kit based on Companies built for Filament:
- :fire: Authentication - Fortify
- :fire: Socialite (Optional)
- :fire: Terms & Privacy Policy
- :fire: Password Reset via Email
- :fire: Personal Profile Management
- :fire: Two-Factor Authentication (2FA)
- :fire: Browser Session Management
- :fire: Sanctum API
- :fire: Company Management
- :fire: Employee Invitations via Email
- :fire: Roles & Permissions
- :fire: And More to Come!
Getting Started
WARNING
- This plugin requires a fresh Filament project.
- If you install this plugin into an existing Filament project, you will get errors.
Note
- Example application using package: https://github.com/andrewdwallo/erpsaas/tree/1.x
Getting Set Up
- Create a fresh Laravel Project
- Configure your database
- Install the filament admin package
Installation
Install this package
After installing the package, you may execute the filament-companies:install
Artisan command. This command requires the name of the stack to be filament
and the option to be --companies
. In addition, you may use the --socialite
switch to enable socialite support.
Use one of the following commands to scaffold the application:
Finalizing Installation
Translations
If you wish to translate the package, you may publish the language files using:
Usage
If you would like, you may create a new account using:
You may also create a new account by registering through the application.
In the Laravel Welcome Page, you may:
- Login
- Register
In the company dropdown, you may:
- Create a new company
- Manage your current company's settings
- Switch your current company
In the user dropdown, where your avatar is, you may:
- Create API Tokens
- Manage your personal profile's settings
This package is extensively "borrowed" from the work of Taylor Otwell, his contributors and the Laravel Jetstream package. You can get a full understanding of the capabilities by reviewing the Jetstream Documentation.
If you want to change the filament path prefix to something such as "company", you may do so as you normally would in config/filament.php
The Laravel Welcome Page & Fortify will respect your changes
Socialite
By Default, the GitHub Provider will be enabled.
You may use any Provider that Laravel Socialite supports.
You may add or remove any Provider in config/filament-companies.php
If Twitter is desired, you may only use either Twitter OAuth1 or Twitter OAuth2, not both.
You may use this syntax if it is desired.
In config/services.php
pass your Provider's credentials in the providers array:
The Provider's Redirect URI must look similar to the above (e.g. 'APP_URL/oauth/provider_name/callback')
An Example: How to Set Up GitHub (using Filament as Application Name & APP_URL)
- Go to https://github.com/settings/applications/new
- Application Name:
Filament
- Homepage URL:
https://filament.test/admin
- Authorization callback URL:
https://filament.test/oauth/github/callback
- Click on Device Flow & Save
- Copy the Client Secret & store somewhere safe.
Authorization callback URL = 'redirect' from above
In the .env
file, for example:
You may temporarily turn off Socialite support if you previously chose it as an option during installation:
The Socialite package is extensively "borrowed" from the work of Joel Butcher, his contributors and the Socialstream package. You can get a full understanding of the capabilities by reviewing the Socialstream Documentation.
The following examples are a visual representation of the features this package supports that were provided by the methods implemented in Laravel Jetstream. You may find all of the features as provided by the Laravel Jetstream package here in their documentation.
Information about a user's companies may be accessed via the methods provided by the Wallo\FilamentCompanies\HasCompanies
trait. This trait is automatically applied to your application's App\Models\User
model during installation. This trait provides a variety of helpful methods that allow you to inspect a user's companies or company:
$user represents the current user of the application. Interchangeable with
Auth::user()
Example #1: Only allowing a certain company ID to see & visit a filament page, resource, etc...
Example #2: Using the Current Company Name
You can use collections of different companies and group them together, or you may use different ranges of values, and more.
Company Invitations
In my opinion, if you are using GMAIL & you are testing, this is the easiest route to setup the Mail Server:
- Go to https://myaccount.google.com/apppasswords (May ask you to Sign in)
- Click on "Select app", enter name of Application, then click "Generate".
- Copy your app password and store it somewhere safe.
In your application's .env
file, for example:
Port does not have to be specific
Roles & Permissions
You may change roles & permissions in app/Providers/FilamentCompaniesServiceProvider.php
Notice
- This package is planned to be used as a Context in Filament V3.
- The default view after installation is not supposed to be the "Admin" Context, this would be the view that a "company owner" or "company user" would see.
- There are methods to support an "Admin" Context if desired.
Contributing
- Fork this repository to your GitHub account.
- Create a fresh Laravel & Filament Project.
- Clone your fork in your App's root directory.
- In the
/filament-companies
directory, create a branch for your fix, e.g.fix/error-message
.
Install the package in your application's composer.json
file using the dev
prefix followed by your branches name:
Now, run composer update
and continue by following the installation instructions above.
All versions of filament-companies with dependencies
ext-json Version *
filament/filament Version ^2.0
illuminate/console Version ^8.6|^9.0|^10.0
illuminate/contracts Version ^8.6|^9.0|^10.0
illuminate/support Version ^8.6|^9.0|^10.0
laravel/fortify Version ^1.15
laravel/socialite Version ^5.6
matomo/device-detector Version ^6.1