Integrate Nop with Filament. The package will enable Nop on all the edit pages of your Filament admin dashboard, e.g. /admin/projects/<id>/edit
, preventing multiple users to access the same page simultaneously.
Install the package via composer:
composer require nop-app/filament
Then publish the package config file:
php artisan vendor:publish --tag=nop-config
There are a few notable configuration options for the package.
Key | Type | Description |
---|---|---|
token |
String | Your Nop token. If you don't have a project yet, create one for free at https://nop.is/account/projects/create. |
enabled_routes |
Array | List of routes (RegExp) where Nop should be enabled. By default it will be enabled in every "resource" edit page. |
user_name_field |
String|Null | The field corresponding to current authenticated user "name". |
settings |
Array | Additional Nop settings. You can take a look to the official Docs to find out more. |
If you need advanced logic for the user "name" field, you can set user_name_field
to null
in your config/nop.php
file and then, although it's not defined in the values, set the nop.name
config.
For example in a middleware you can do:
// app/Http/Middleware/NopUser.php
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Support\Facades\Config;
class NopUser
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if (Auth::check()) {
Config::set('nop.user', $userName);
}
return $next($request);
}
}
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
This package was generated using the Laravel Package Boilerplate.