battle with structure
This commit is contained in:
BIN
app/Console/.DS_Store
vendored
Normal file
BIN
app/Console/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
app/Console/Commands/.DS_Store
vendored
Normal file
BIN
app/Console/Commands/.DS_Store
vendored
Normal file
Binary file not shown.
309
app/Console/Commands/MakeModule.php
Normal file
309
app/Console/Commands/MakeModule.php
Normal file
@@ -0,0 +1,309 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
use Illuminate\Contracts\Console\PromptsForMissingInput;
|
||||||
|
use Illuminate\Database\Migrations\MigrationCreator;
|
||||||
|
use Illuminate\Filesystem\Filesystem;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
|
class MakeModule extends Command implements PromptsForMissingInput
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Filesystem instance
|
||||||
|
*/
|
||||||
|
protected Filesystem $files;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Module name
|
||||||
|
*/
|
||||||
|
protected string $moduleName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Module directory path
|
||||||
|
*/
|
||||||
|
protected string $moduleDirectory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The name and signature of the console command.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $signature = 'make:module {module}';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The console command description.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = 'Create new module';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prompt for missing input arguments using the returned questions.
|
||||||
|
*
|
||||||
|
* @return array<string, array<int, string>>
|
||||||
|
*/
|
||||||
|
protected function promptForMissingArgumentsUsing(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'module' => ['Module name', 'News, Product, Order...'],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new command instance.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function __construct(Filesystem $files)
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
|
$this->files = $files;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the console command.
|
||||||
|
*/
|
||||||
|
public function handle(): void
|
||||||
|
{
|
||||||
|
/* @var string */
|
||||||
|
$module = $this->argument('module');
|
||||||
|
$this->moduleName = $module;
|
||||||
|
$this->moduleDirectory = modules_path($module.'/');
|
||||||
|
|
||||||
|
// Create module directory if not exists...
|
||||||
|
$this->makeDirectory($this->moduleDirectory);
|
||||||
|
|
||||||
|
// Make a module file...
|
||||||
|
$this->makeModuleFile($this->moduleDirectory);
|
||||||
|
|
||||||
|
// Models...
|
||||||
|
$this->makeDirectory($this->moduleDirectory.'Models');
|
||||||
|
$this->makeModelFile($this->moduleDirectory.'Models');
|
||||||
|
|
||||||
|
// Database...
|
||||||
|
$this->makeDirectory($this->moduleDirectory.'Database');
|
||||||
|
$this->makeDirectory($this->moduleDirectory.'Database/Migrations');
|
||||||
|
$this->makeMigrationFile($this->moduleDirectory.'Database/Migrations');
|
||||||
|
|
||||||
|
// Controller...
|
||||||
|
$this->makeDirectory($this->moduleDirectory.'Controllers');
|
||||||
|
$this->makeController($this->moduleDirectory.'Controllers');
|
||||||
|
|
||||||
|
// Repository...
|
||||||
|
$this->makeDirectory($this->moduleDirectory.'Repositories');
|
||||||
|
$this->makeRepository($this->moduleDirectory.'Repositories');
|
||||||
|
|
||||||
|
// Filament resource...
|
||||||
|
$this->makeDirectory($this->moduleDirectory.'Filament');
|
||||||
|
$this->makeDirectory($this->moduleDirectory.'Filament/Resources');
|
||||||
|
$this->makeFilamentResource($this->moduleDirectory.'Filament/Resources');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Make module file
|
||||||
|
*/
|
||||||
|
public function makeModuleFile(string $moduleDirectory): void
|
||||||
|
{
|
||||||
|
$creationStatus = $this->createFileFromStub(
|
||||||
|
createFilePath: sprintf('%s/%sModule', $moduleDirectory, $this->moduleName),
|
||||||
|
stubFile: __DIR__.'/stubs/make-module/module.stub',
|
||||||
|
stubVariables: [
|
||||||
|
'NAMESPACE' => sprintf('App\\Modules\\%s', $this->moduleName),
|
||||||
|
'CLASS_NAME' => $this->moduleName.'Module',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
$creationStatus
|
||||||
|
? $this->info("Module created: {$this->moduleName} created")
|
||||||
|
: $this->info("Module: {$this->moduleName} already exits");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Make model file
|
||||||
|
*/
|
||||||
|
protected function makeModelFile(string $modelPath): void
|
||||||
|
{
|
||||||
|
$creationStatus = $this->createFileFromStub(
|
||||||
|
createFilePath: sprintf('%s/%s', $modelPath, $this->moduleName),
|
||||||
|
stubFile: __DIR__.'/stubs/make-module/model.stub',
|
||||||
|
stubVariables: [
|
||||||
|
'NAMESPACE' => sprintf('App\\Modules\\%s\\Models', $this->moduleName),
|
||||||
|
'CLASS_NAME' => $this->moduleName,
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
$creationStatus
|
||||||
|
? $this->info("Model created: {$this->moduleName} created")
|
||||||
|
: $this->info("Model: {$this->moduleName} already exits");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Make migration file
|
||||||
|
*/
|
||||||
|
protected function makeMigrationFile(string $migrationsPath): void
|
||||||
|
{
|
||||||
|
$migrationCreator = new MigrationCreator(
|
||||||
|
files: new Filesystem,
|
||||||
|
customStubPath: app_path('Console/Commands/stubs/make-module/migration.stub')
|
||||||
|
);
|
||||||
|
|
||||||
|
$migrationPath = $migrationCreator->create(Str::lower('create_'.Str::snake(Str::plural($this->moduleName)).'_table'), $migrationsPath);
|
||||||
|
$migrationName = Str::afterLast($migrationPath, '/');
|
||||||
|
|
||||||
|
$this->info("Migration created: {$migrationName} created");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Make controller file
|
||||||
|
*/
|
||||||
|
protected function makeController(string $controllersPath): void
|
||||||
|
{
|
||||||
|
$creationStatus = $this->createFileFromStub(
|
||||||
|
createFilePath: sprintf('%s/%sController', $controllersPath, $this->moduleName),
|
||||||
|
stubFile: app_path('Console/Commands/stubs/make-module/controller.stub'),
|
||||||
|
stubVariables: [
|
||||||
|
'NAMESPACE' => sprintf('App\\Modules\\%s\\Controllers', $this->moduleName),
|
||||||
|
'CONTROLLER_NAME' => $this->moduleName.'Controller',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
$creationStatus
|
||||||
|
? $this->info("Controller created: {$this->moduleName} created")
|
||||||
|
: $this->info("Controller: {$this->moduleName} already exits");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Make repository file
|
||||||
|
*/
|
||||||
|
protected function makeRepository(string $path): void
|
||||||
|
{
|
||||||
|
$creationStatus = $this->createFileFromStub(
|
||||||
|
createFilePath: sprintf('%s/%s', $path, $this->moduleName.'Repository'),
|
||||||
|
stubFile: __DIR__.'/stubs/make-module/repository.stub',
|
||||||
|
stubVariables: [
|
||||||
|
'NAMESPACE' => sprintf('App\Modules\%s\Repositories', $this->moduleName),
|
||||||
|
'MODULE_NAME' => ucfirst($this->moduleName),
|
||||||
|
'MODEL_NAMESPACE' => sprintf('App\Modules\%s\Models\%s', $this->moduleName, $this->moduleName),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
|
||||||
|
$creationStatus
|
||||||
|
? $this->info("Repository created: {$this->moduleName} created")
|
||||||
|
: $this->info("Repository: {$this->moduleName} already exits");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Make nova resource file
|
||||||
|
*/
|
||||||
|
public function makeFilamentResource(string $path): void
|
||||||
|
{
|
||||||
|
// Base resource...
|
||||||
|
$resourceCreateStatus = $this->createFileFromStub(
|
||||||
|
createFilePath: sprintf('%s/%s', $path, $this->moduleName.'Resource'),
|
||||||
|
stubFile: __DIR__.'/stubs/make-module/filament/base-resource.stub',
|
||||||
|
stubVariables: [
|
||||||
|
'NAMESPACE' => sprintf('App\Modules\%s\Filament\Resources', $this->moduleName),
|
||||||
|
'MODEL_NAMESPACE' => sprintf('App\Modules\%s\Models\%s', $this->moduleName, $this->moduleName),
|
||||||
|
'MODEL_NAME_SINGULAR' => Str::of($this->moduleName)->singular(),
|
||||||
|
'MODEL_NAME_PLURAL' => Str::of($this->moduleName)->plural(),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
|
||||||
|
$resourceCreateStatus
|
||||||
|
? $this->info("Filament resource created: {$this->moduleName} created")
|
||||||
|
: $this->info("Filament resource: {$this->moduleName} already exits");
|
||||||
|
|
||||||
|
$resourcePagesDir = $this->makeDirectory(sprintf('%s/%sResource', $path, $this->moduleName));
|
||||||
|
|
||||||
|
// Create page...
|
||||||
|
$resourceCreatePageStatus = $this->createFileFromStub(
|
||||||
|
createFilePath: sprintf('%s/Create%s', $resourcePagesDir, $this->moduleName),
|
||||||
|
stubFile: __DIR__.'/stubs/make-module/filament/pages/create-resource-page.stub',
|
||||||
|
stubVariables: [
|
||||||
|
'CREATE_RESOURCE_PAGE_NAMESPACE' => sprintf('App\Modules\%s\Filament\Resources\%sResource\Pages', $this->moduleName, $this->moduleName),
|
||||||
|
'BASE_RESOURCE_NAMESPACE' => sprintf('App\Modules\%s\Filament\Resources\%sResource', $this->moduleName, $this->moduleName),
|
||||||
|
'MODEL_NAME_SINGULAR' => Str::of($this->moduleName)->singular(),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
|
||||||
|
$resourceCreatePageStatus
|
||||||
|
? $this->info("Filament create page resource created: {$this->moduleName} created")
|
||||||
|
: $this->info("Filament create page resource: {$this->moduleName} already exits");
|
||||||
|
|
||||||
|
// Edit page...
|
||||||
|
$resourceEditPageStatus = $this->createFileFromStub(
|
||||||
|
createFilePath: sprintf('%s/Edit%s', $resourcePagesDir, $this->moduleName),
|
||||||
|
stubFile: __DIR__.'/stubs/make-module/filament/pages/edit-resource-page.stub',
|
||||||
|
stubVariables: [
|
||||||
|
'EDIT_RESOURCE_PAGE_NAMESPACE' => sprintf('App\Modules\%s\Filament\Resources\%sResource\Pages', $this->moduleName, $this->moduleName),
|
||||||
|
'BASE_RESOURCE_NAMESPACE' => sprintf('App\Modules\%s\Filament\Resources\%sResource', $this->moduleName, $this->moduleName),
|
||||||
|
'MODEL_NAME_SINGULAR' => Str::of($this->moduleName)->singular(),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
|
||||||
|
$resourceEditPageStatus
|
||||||
|
? $this->info("Filament edit page resource created: {$this->moduleName} created")
|
||||||
|
: $this->info("Filament edit page resource: {$this->moduleName} already exits");
|
||||||
|
|
||||||
|
// List page...
|
||||||
|
$resourceListPageStatus = $this->createFileFromStub(
|
||||||
|
createFilePath: sprintf('%s/List%s', $resourcePagesDir, Str::of($this->moduleName)->plural()),
|
||||||
|
stubFile: __DIR__.'/stubs/make-module/filament/pages/list-resource-page.stub',
|
||||||
|
stubVariables: [
|
||||||
|
'LIST_RESOURCE_PAGE_NAMESPACE' => sprintf('App\Modules\%s\Filament\Resources\%sResource\Pages', $this->moduleName, $this->moduleName),
|
||||||
|
'BASE_RESOURCE_NAMESPACE' => sprintf('App\Modules\%s\Filament\Resources\%sResource', $this->moduleName, $this->moduleName),
|
||||||
|
'MODEL_NAME_SINGULAR' => Str::of($this->moduleName)->singular(),
|
||||||
|
'MODEL_NAME_PLURAL' => Str::of($this->moduleName)->plural(),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
|
||||||
|
$resourceListPageStatus
|
||||||
|
? $this->info("Filament list page resource created: {$this->moduleName} created")
|
||||||
|
: $this->info("Filament list page resource: {$this->moduleName} already exits");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Build the directory for the class if necessary.
|
||||||
|
*/
|
||||||
|
protected function makeDirectory(string $path): string
|
||||||
|
{
|
||||||
|
if (! $this->files->isDirectory($path)) {
|
||||||
|
$this->files->makeDirectory($path, 0777, true, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $path;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a file from stub
|
||||||
|
*
|
||||||
|
* @param array<string, string> $stubVariables
|
||||||
|
*/
|
||||||
|
protected function createFileFromStub(string $createFilePath, string $stubFile, array $stubVariables): int|bool
|
||||||
|
{
|
||||||
|
$contents = $this->getStubContents($stubFile, $stubVariables);
|
||||||
|
|
||||||
|
return $this->files->missing($createFilePath)
|
||||||
|
? $this->files->put($createFilePath.'.php', $contents)
|
||||||
|
: false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Replace the stub variables(key) with the desire value
|
||||||
|
*
|
||||||
|
* @param array<string, string> $stubVariables
|
||||||
|
*/
|
||||||
|
protected function getStubContents(string $stub, array $stubVariables = []): string
|
||||||
|
{
|
||||||
|
$contents = (string) file_get_contents($stub);
|
||||||
|
|
||||||
|
foreach ($stubVariables as $search => $replace) {
|
||||||
|
$contents = str_replace('$'.$search.'$', $replace, $contents);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $contents;
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
app/Console/Commands/stubs/make-module/.DS_Store
vendored
Normal file
BIN
app/Console/Commands/stubs/make-module/.DS_Store
vendored
Normal file
Binary file not shown.
49
app/Console/Commands/stubs/make-module/controller.stub
Normal file
49
app/Console/Commands/stubs/make-module/controller.stub
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace $NAMESPACE$;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class $CONTROLLER_NAME$ extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Display a listing of the resource.
|
||||||
|
*/
|
||||||
|
public function index(Request $request): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store a newly created resource in storage.
|
||||||
|
*/
|
||||||
|
public function store(Request $request): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display the specified resource.
|
||||||
|
*/
|
||||||
|
public function show(Request $request): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the specified resource in storage.
|
||||||
|
*/
|
||||||
|
public function update(Request $request): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the specified resource from storage.
|
||||||
|
*/
|
||||||
|
public function destroy(Request $request): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace $NAMESPACE$;
|
||||||
|
|
||||||
|
use App\Modules\$MODEL_NAME_SINGULAR$\Filament\Resources\$MODEL_NAME_SINGULAR$Resource\Pages\Create$MODEL_NAME_SINGULAR$;
|
||||||
|
use App\Modules\$MODEL_NAME_SINGULAR$\Filament\Resources\$MODEL_NAME_SINGULAR$Resource\Pages\Edit$MODEL_NAME_SINGULAR$;
|
||||||
|
use App\Modules\$MODEL_NAME_SINGULAR$\Filament\Resources\$MODEL_NAME_SINGULAR$Resource\Pages\List$MODEL_NAME_SINGULAR$s;
|
||||||
|
use $MODEL_NAMESPACE$;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
|
||||||
|
class $MODEL_NAME_SINGULAR$Resource extends Resource
|
||||||
|
{
|
||||||
|
protected static ?string $model = $MODEL_NAME_SINGULAR$::class;
|
||||||
|
|
||||||
|
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||||
|
|
||||||
|
public static function form(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->schema([
|
||||||
|
// ...
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => List$MODEL_NAME_PLURAL$::route('/'),
|
||||||
|
'create' => Create$MODEL_NAME_SINGULAR$::route('/create'),
|
||||||
|
'edit' => Edit$MODEL_NAME_SINGULAR$::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace $CREATE_RESOURCE_PAGE_NAMESPACE$;
|
||||||
|
|
||||||
|
use $BASE_RESOURCE_NAMESPACE$;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class Create$MODEL_NAME_SINGULAR$ extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = $MODEL_NAME_SINGULAR$Resource::class;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace $EDIT_RESOURCE_PAGE_NAMESPACE$;
|
||||||
|
|
||||||
|
use $BASE_RESOURCE_NAMESPACE$;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class Edit$MODEL_NAME_SINGULAR$ extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = $MODEL_NAME_SINGULAR$Resource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace $LIST_RESOURCE_PAGE_NAMESPACE$;
|
||||||
|
|
||||||
|
use $BASE_RESOURCE_NAMESPACE$;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class List$MODEL_NAME_PLURAL$ extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = $MODEL_NAME_SINGULAR$Resource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
27
app/Console/Commands/stubs/make-module/migration.stub
Executable file
27
app/Console/Commands/stubs/make-module/migration.stub
Executable file
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('{{ table }}', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('{{ table }}');
|
||||||
|
}
|
||||||
|
};
|
||||||
11
app/Console/Commands/stubs/make-module/model.stub
Normal file
11
app/Console/Commands/stubs/make-module/model.stub
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace $NAMESPACE$;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Concerns\HasUuids;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class $CLASS_NAME$ extends Model
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
48
app/Console/Commands/stubs/make-module/module.stub
Normal file
48
app/Console/Commands/stubs/make-module/module.stub
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace $NAMESPACE$;
|
||||||
|
|
||||||
|
use App\Modules\Makeable;
|
||||||
|
use App\Modules\ModuleContract;
|
||||||
|
|
||||||
|
class $CLASS_NAME$ implements ModuleContract
|
||||||
|
{
|
||||||
|
use Makeable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Module is enabled
|
||||||
|
*/
|
||||||
|
protected bool $enabled = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if is module enabled
|
||||||
|
*/
|
||||||
|
public function isEnabled(): bool
|
||||||
|
{
|
||||||
|
return $this->enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disable module
|
||||||
|
*/
|
||||||
|
public function disable(): void
|
||||||
|
{
|
||||||
|
$this->enabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable module
|
||||||
|
*/
|
||||||
|
public function enable(): void
|
||||||
|
{
|
||||||
|
$this->enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if module has a filament resource
|
||||||
|
*/
|
||||||
|
public function hasFilamentResource(): bool
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
74
app/Console/Commands/stubs/make-module/nova-resource.stub
Normal file
74
app/Console/Commands/stubs/make-module/nova-resource.stub
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace $NAMESPACE$;
|
||||||
|
|
||||||
|
use App\Nova\Resource;
|
||||||
|
use Laravel\Nova\Fields\ID;
|
||||||
|
use Laravel\Nova\Http\Requests\NovaRequest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @template TModel of \$MODEL_NAMESPACE$
|
||||||
|
*
|
||||||
|
* @extends Resource<TModel>
|
||||||
|
*/
|
||||||
|
class $RESOURCE_NAME_SINGULAR$ extends Resource
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The model the resource corresponds to.
|
||||||
|
*
|
||||||
|
* @var class-string<\$MODEL_NAMESPACE$>
|
||||||
|
*/
|
||||||
|
public static $model = \$MODEL_NAMESPACE$::class;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The single value that should be used to represent the resource when being displayed.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
public static $title = 'id';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The columns that should be searched.
|
||||||
|
*
|
||||||
|
* @var array<int, string>
|
||||||
|
*/
|
||||||
|
public static $search = [
|
||||||
|
'id',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The relationships that should be eager loaded on index queries.
|
||||||
|
*
|
||||||
|
* @var array<int, string>
|
||||||
|
*/
|
||||||
|
// public static $with = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the displayable label of the resource.
|
||||||
|
*/
|
||||||
|
public static function label(): string
|
||||||
|
{
|
||||||
|
return __('$MODEL_NAME_PLURAL$');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the displayable singular label of the resource.
|
||||||
|
*/
|
||||||
|
public static function singularLabel(): string
|
||||||
|
{
|
||||||
|
return __('$MODEL_NAME_SINGULAR$');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the fields displayed by the resource.
|
||||||
|
*
|
||||||
|
* @param \Laravel\Nova\Http\Requests\NovaRequest $request
|
||||||
|
* @return array<int, \Laravel\Nova\Fields\FieldElement|\Laravel\Nova\Panel>
|
||||||
|
*/
|
||||||
|
public function fields(NovaRequest $request): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
ID::make('id')->sortable(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
10
app/Console/Commands/stubs/make-module/repository.stub
Normal file
10
app/Console/Commands/stubs/make-module/repository.stub
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace $NAMESPACE$;
|
||||||
|
|
||||||
|
use $MODEL_NAMESPACE$;
|
||||||
|
|
||||||
|
class $MODULE_NAME$Repository
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,5 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Modules\EmptyModule;
|
||||||
|
use App\Modules\ModuleContract;
|
||||||
|
use Illuminate\Support\Collection;
|
||||||
|
use Illuminate\Support\Facades\File;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Application locales
|
* Application locales
|
||||||
*
|
*
|
||||||
@@ -9,3 +15,64 @@ function appLocales(): array
|
|||||||
{
|
{
|
||||||
return config()->array('app.locales');
|
return config()->array('app.locales');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get module
|
||||||
|
*/
|
||||||
|
function module(string $moduleName): ModuleContract
|
||||||
|
{
|
||||||
|
$moduleClass = 'App\\Modules\\'.$moduleName.'\\'.$moduleName.'Module';
|
||||||
|
|
||||||
|
return class_exists($moduleClass) ? (new $moduleClass) : emptyModule();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Empty module
|
||||||
|
*/
|
||||||
|
function emptyModule(): ModuleContract
|
||||||
|
{
|
||||||
|
return new EmptyModule;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Modules directory path
|
||||||
|
*/
|
||||||
|
function modules_path(string $path = ''): string
|
||||||
|
{
|
||||||
|
return app_path('Modules/'.$path);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Modules
|
||||||
|
*
|
||||||
|
* @return Collection<array-key, string>
|
||||||
|
*/
|
||||||
|
function modules(bool $withDisabled = false): Collection
|
||||||
|
{
|
||||||
|
/** @var array<int, string> */
|
||||||
|
$modulesDir = File::directories(modules_path());
|
||||||
|
$modules = collect();
|
||||||
|
|
||||||
|
foreach ($modulesDir as $modulePath) {
|
||||||
|
$moduleName = Str::afterLast($modulePath, '/');
|
||||||
|
|
||||||
|
$moduleOptions = [
|
||||||
|
'path' => $modulePath,
|
||||||
|
'name' => $moduleName.'Module',
|
||||||
|
'enabled' => module($moduleName)->isEnabled(),
|
||||||
|
];
|
||||||
|
|
||||||
|
$modules->push($moduleOptions);
|
||||||
|
|
||||||
|
// Include all
|
||||||
|
if ($withDisabled) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($moduleOptions['enabled']) {
|
||||||
|
$modules->push($moduleOptions);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $modules;
|
||||||
|
}
|
||||||
|
|||||||
32
app/Modules/EmptyModule.php
Normal file
32
app/Modules/EmptyModule.php
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Modules;
|
||||||
|
|
||||||
|
class EmptyModule implements ModuleContract
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Check if is module enabled
|
||||||
|
*/
|
||||||
|
public function isEnabled(): bool
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disable module
|
||||||
|
*/
|
||||||
|
public function disable(): void {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable module
|
||||||
|
*/
|
||||||
|
public function enable(): void {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if module has a filament resource
|
||||||
|
*/
|
||||||
|
public function hasFilamentResource(): bool
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Modules\EntrepreneurLetterNumber\Controllers;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
|
class EntrepreneurLetterNumberController extends Controller
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Display a listing of the resource.
|
||||||
|
*/
|
||||||
|
public function index(Request $request): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Store a newly created resource in storage.
|
||||||
|
*/
|
||||||
|
public function store(Request $request): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display the specified resource.
|
||||||
|
*/
|
||||||
|
public function show(Request $request): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the specified resource in storage.
|
||||||
|
*/
|
||||||
|
public function update(Request $request): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the specified resource from storage.
|
||||||
|
*/
|
||||||
|
public function destroy(Request $request): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Modules\EntrepreneurLetterNumber;
|
||||||
|
|
||||||
|
use App\Modules\Makeable;
|
||||||
|
use App\Modules\ModuleContract;
|
||||||
|
|
||||||
|
class EntrepreneurLetterNumberModule implements ModuleContract
|
||||||
|
{
|
||||||
|
use Makeable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Module is enabled
|
||||||
|
*/
|
||||||
|
protected bool $enabled = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if is module enabled
|
||||||
|
*/
|
||||||
|
public function isEnabled(): bool
|
||||||
|
{
|
||||||
|
return $this->enabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disable module
|
||||||
|
*/
|
||||||
|
public function disable(): void
|
||||||
|
{
|
||||||
|
$this->enabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable module
|
||||||
|
*/
|
||||||
|
public function enable(): void
|
||||||
|
{
|
||||||
|
$this->enabled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if module has a filament resource
|
||||||
|
*/
|
||||||
|
public function hasFilamentResource(): bool
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Modules\EntrepreneurLetterNumber\Filament\Resources;
|
||||||
|
|
||||||
|
use App\Modules\EntrepreneurLetterNumber\Filament\Resources\EntrepreneurLetterNumberResource\Pages\CreateEntrepreneurLetterNumber;
|
||||||
|
use App\Modules\EntrepreneurLetterNumber\Filament\Resources\EntrepreneurLetterNumberResource\Pages\EditEntrepreneurLetterNumber;
|
||||||
|
use App\Modules\EntrepreneurLetterNumber\Filament\Resources\EntrepreneurLetterNumberResource\Pages\ListEntrepreneurLetterNumbers;
|
||||||
|
use App\Modules\EntrepreneurLetterNumber\Models\EntrepreneurLetterNumber;
|
||||||
|
use Filament\Forms\Form;
|
||||||
|
use Filament\Resources\Resource;
|
||||||
|
use Filament\Tables;
|
||||||
|
use Filament\Tables\Table;
|
||||||
|
|
||||||
|
class EntrepreneurLetterNumberResource extends Resource
|
||||||
|
{
|
||||||
|
protected static ?string $model = EntrepreneurLetterNumber::class;
|
||||||
|
|
||||||
|
protected static ?string $navigationIcon = 'heroicon-o-rectangle-stack';
|
||||||
|
|
||||||
|
public static function form(Form $form): Form
|
||||||
|
{
|
||||||
|
return $form
|
||||||
|
->schema([
|
||||||
|
// ...
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function table(Table $table): Table
|
||||||
|
{
|
||||||
|
return $table
|
||||||
|
->columns([
|
||||||
|
|
||||||
|
])
|
||||||
|
->filters([
|
||||||
|
//
|
||||||
|
])
|
||||||
|
->actions([
|
||||||
|
Tables\Actions\EditAction::make(),
|
||||||
|
])
|
||||||
|
->bulkActions([
|
||||||
|
Tables\Actions\BulkActionGroup::make([
|
||||||
|
Tables\Actions\DeleteBulkAction::make(),
|
||||||
|
]),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getRelations(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function getPages(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
'index' => ListEntrepreneurLetterNumbers::route('/'),
|
||||||
|
'create' => CreateEntrepreneurLetterNumber::route('/create'),
|
||||||
|
'edit' => EditEntrepreneurLetterNumber::route('/{record}/edit'),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Modules\EntrepreneurLetterNumber\Filament\Resources\EntrepreneurLetterNumberResource\Pages;
|
||||||
|
|
||||||
|
use App\Modules\EntrepreneurLetterNumber\Filament\Resources\EntrepreneurLetterNumberResource;
|
||||||
|
use Filament\Resources\Pages\CreateRecord;
|
||||||
|
|
||||||
|
class CreateEntrepreneurLetterNumber extends CreateRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = EntrepreneurLetterNumberResource::class;
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Modules\EntrepreneurLetterNumber\Filament\Resources\EntrepreneurLetterNumberResource\Pages;
|
||||||
|
|
||||||
|
use App\Modules\EntrepreneurLetterNumber\Filament\Resources\EntrepreneurLetterNumberResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\EditRecord;
|
||||||
|
|
||||||
|
class EditEntrepreneurLetterNumber extends EditRecord
|
||||||
|
{
|
||||||
|
protected static string $resource = EntrepreneurLetterNumberResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\DeleteAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Modules\EntrepreneurLetterNumber\Filament\Resources\EntrepreneurLetterNumberResource\Pages;
|
||||||
|
|
||||||
|
use App\Modules\EntrepreneurLetterNumber\Filament\Resources\EntrepreneurLetterNumberResource;
|
||||||
|
use Filament\Actions;
|
||||||
|
use Filament\Resources\Pages\ListRecords;
|
||||||
|
|
||||||
|
class ListEntrepreneurLetterNumbers extends ListRecords
|
||||||
|
{
|
||||||
|
protected static string $resource = EntrepreneurLetterNumberResource::class;
|
||||||
|
|
||||||
|
protected function getHeaderActions(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
Actions\CreateAction::make(),
|
||||||
|
];
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Modules\EntrepreneurLetterNumber\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class EntrepreneurLetterNumber extends Model {}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Modules\EntrepreneurLetterNumber\Repositories;
|
||||||
|
|
||||||
|
class EntrepreneurLetterNumberRepository {}
|
||||||
17
app/Modules/Makeable.php
Normal file
17
app/Modules/Makeable.php
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Modules;
|
||||||
|
|
||||||
|
trait Makeable
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Create a new element.
|
||||||
|
*
|
||||||
|
* @param mixed ...$arguments
|
||||||
|
* @return static
|
||||||
|
*/
|
||||||
|
public static function make(...$arguments)
|
||||||
|
{
|
||||||
|
return new static(...$arguments);
|
||||||
|
}
|
||||||
|
}
|
||||||
26
app/Modules/ModuleContract.php
Normal file
26
app/Modules/ModuleContract.php
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Modules;
|
||||||
|
|
||||||
|
interface ModuleContract
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Check if is module enabled
|
||||||
|
*/
|
||||||
|
public function isEnabled(): bool;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disable module
|
||||||
|
*/
|
||||||
|
public function disable(): void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Enable module
|
||||||
|
*/
|
||||||
|
public function enable(): void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if module has a filament resource
|
||||||
|
*/
|
||||||
|
public function hasFilamentResource(): bool;
|
||||||
|
}
|
||||||
@@ -22,5 +22,15 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
{
|
{
|
||||||
Model::unguard();
|
Model::unguard();
|
||||||
Model::shouldBeStrict(! app()->isProduction());
|
Model::shouldBeStrict(! app()->isProduction());
|
||||||
|
|
||||||
|
$this->registerModules();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register modules
|
||||||
|
*/
|
||||||
|
public function registerModules(): void
|
||||||
|
{
|
||||||
|
modules();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ use Filament\Pages;
|
|||||||
use Filament\Panel;
|
use Filament\Panel;
|
||||||
use Filament\PanelProvider;
|
use Filament\PanelProvider;
|
||||||
use Filament\Support\Colors\Color;
|
use Filament\Support\Colors\Color;
|
||||||
use Filament\Widgets;
|
|
||||||
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
|
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
|
||||||
use Illuminate\Cookie\Middleware\EncryptCookies;
|
use Illuminate\Cookie\Middleware\EncryptCookies;
|
||||||
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
|
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
|
||||||
@@ -24,8 +23,8 @@ class AdminPanelProvider extends PanelProvider
|
|||||||
{
|
{
|
||||||
return $panel
|
return $panel
|
||||||
->default()
|
->default()
|
||||||
->id('admin')
|
->id('panel')
|
||||||
->path('admin')
|
->path('panel')
|
||||||
->login()
|
->login()
|
||||||
->colors([
|
->colors([
|
||||||
'primary' => Color::Amber,
|
'primary' => Color::Amber,
|
||||||
@@ -37,8 +36,6 @@ class AdminPanelProvider extends PanelProvider
|
|||||||
])
|
])
|
||||||
->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')
|
->discoverWidgets(in: app_path('Filament/Widgets'), for: 'App\\Filament\\Widgets')
|
||||||
->widgets([
|
->widgets([
|
||||||
Widgets\AccountWidget::class,
|
|
||||||
Widgets\FilamentInfoWidget::class,
|
|
||||||
])
|
])
|
||||||
->middleware([
|
->middleware([
|
||||||
EncryptCookies::class,
|
EncryptCookies::class,
|
||||||
|
|||||||
@@ -6,5 +6,7 @@ parameters:
|
|||||||
paths:
|
paths:
|
||||||
- app/
|
- app/
|
||||||
|
|
||||||
# Level 9 is the highest level
|
|
||||||
level: 6
|
level: 6
|
||||||
|
|
||||||
|
ignoreErrors:
|
||||||
|
- '#Unsafe usage of new static#'
|
||||||
|
|||||||
Reference in New Issue
Block a user