first commit
Some checks failed
Build / run (push) Has been cancelled

This commit is contained in:
maher
2025-10-29 11:42:25 +01:00
commit 703f50a09d
4595 changed files with 385164 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
<?php
namespace Common\Generators\Model;
use Illuminate\Foundation\Console\ModelMakeCommand;
class GenerateModel extends ModelMakeCommand
{
public function handle()
{
$this->input->setOption('resource', true);
$this->input->setOption('migration', true);
$this->createPolicy();
$this->createRequest();
$this->createAction();
parent::handle();
}
protected function createPolicy()
{
$modelName = $this->getNameInput();
$this->call('make:policy', [
'name' => "{$modelName}Policy",
'--model' => $modelName
]);
}
protected function getStub()
{
return __DIR__.'/stubs/model.stub';
}
private function createRequest()
{
$modelName = $this->getNameInput();
$this->call('make:request', [
'name' => "Crupdate{$modelName}Request",
'--model' => $modelName
]);
}
private function createAction()
{
$modelName = $this->getNameInput();
$this->call('make:action', [
'name' => "Crupdate{$modelName}",
'--model' => $modelName
]);
}
}

View File

@@ -0,0 +1,26 @@
<?php
namespace DummyNamespace;
use Eloquent;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
/**
* DummyNamespace\DummyClass
*
* @property int $id
* @property int $user_id
* @property Carbon|null $created_at
* @property Carbon|null $updated_at
* @mixin Eloquent
*/
class DummyClass extends Model
{
protected $guarded = ['id'];
protected $casts = [
'id' => 'integer',
'user_id' => 'integer',
];
}