nop-app/filament

Nop integration for Filament admin dashboard

v2.0.0 2022-06-18 17:02 UTC

This package is auto-updated.

Last update: 2024-11-18 22:41:00 UTC


README

Latest Version on Packagist Total Downloads

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.

Installation

Install the package via composer:

composer require nop-app/filament

Then publish the package config file:

php artisan vendor:publish --tag=nop-config

Configuration

There are a few notable configuration options for the package.

Advanced user name

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);
    }
}

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email danilo.polani@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.