PHP code example of aurorawebsoftware / filament-astart

1. Go to this page and download the library: Download aurorawebsoftware/filament-astart 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/ */

    

aurorawebsoftware / filament-astart example snippets


use AuroraWebSoftware\FilamentAstart\FilamentAstartPlugin;

public function panel(Panel $panel): Panel
{
    return $panel
        ->plugins([
            FilamentAstartPlugin::make(),
        ]);
}

use AuroraWebSoftware\AAuth\Traits\AAuthUser;
use AuroraWebSoftware\AAuth\Contracts\AAuthUserContract;

class User extends Authenticatable implements AAuthUserContract
{
    use AAuthUser;

    // Your user model logic...
}

'user_menu_style' => env('ASTART_USER_MENU_STYLE', 'classic'),
// 'classic' = Default Filament user menu
// 'modern'  = Enhanced menu with avatar, role badge, org node, theme switcher

'LogiAuditLog' => ['view', 'view_any'],
'LogiAuditHistory' => ['view', 'view_any'],

'logiaudit_log' => ['active' => true, 'navigation_group_key' => null],
'logiaudit_history' => ['active' => true, 'navigation_group_key' => null],

'avatar' => [
    'enabled' => env('ASTART_AVATAR_ENABLED', false),
],

use AuroraWebSoftware\FilamentAstart\Forms\Components\UserSelect;
use AuroraWebSoftware\FilamentAstart\Forms\Components\UserMultiSelect;

UserSelect::make('user_id'),
UserMultiSelect::make('user_ids'),

   use AuroraWebSoftware\AAuth\Interfaces\AAuthABACModelInterface;
   use AuroraWebSoftware\FilamentAstart\Traits\AStartAbacModel;

   class Document extends Model implements AAuthABACModelInterface
   {
       use AStartAbacModel;

       public static function getModelType(): string { return 'document'; }
       public static function getABACRules(): array { return []; }
   }
   

   'abac' => [
       'enabled' => true,
       'models' => [
           'document' => [
               'class' => \App\Models\Document::class,
               'label' => 'Documents',
               'attributes' => [
                   'status' => ['type' => 'string', 'options' => ['draft', 'active']],
                   'amount' => ['type' => 'numeric'],
               ],
           ],
       ],
   ],
   

'user_actions' => [
    [
        'key'        => 'assignment',
        'placement'  => ['table', 'view'],   // ['table'], ['view'] or both
        'route'      => 'admin.user-assignments',
        'params'     => ['user' => 'id'],     // route_param => record attribute
        'label'      => 'Assignment / Matching',
        'icon'       => 'heroicon-o-arrows-right-left',
        'color'      => 'info',
        'new_tab'    => true,
        'sort'       => 10,
        'permission' => null,                 // null = everyone, or an AAuth slug / callable
    ],
],

php artisan filament-astart:install

php artisan vendor:publish --tag="filament-astart-config"

php artisan vendor:publish --tag="filament-astart-lang"

php artisan vendor:publish --tag=filament-astart-seeders
php artisan db:seed --class=SampleFilamentDataSeeder

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