Skip to content

Commit

Permalink
some clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
Mdhesari committed Aug 8, 2023
1 parent 26d63f1 commit 6e4c2ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
10 changes: 6 additions & 4 deletions src/Commands/MakeControllerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ public function handle()
$path = $this->getCompletePath($path);

$contents = $this->getTemplateContents('/controller.stub', [
'NAMESPACE' => 'App\\Http\\Controllers',
'CLASS' => $modelName.'Controller',
'MODEL' => $modelName,
'MODEL_REQUEST' => $modelName.'Request',
'NAMESPACE' => 'App\\Http\\Controllers',
'CLASS' => $modelName.'Controller',
'MODEL' => $modelName,
'MODEL_REQUEST' => $request = $modelName.'Request',
'MODEL_REQUEST_CLASS' => "App\\Http\\Requests\\{$modelName}\\{$request}",
'MODEL_CLASS' => 'App\\Models\\'.$modelName,
]);


Expand Down
4 changes: 2 additions & 2 deletions src/Commands/stubs/controller.stub
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use Throwable;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use App\Models\$MODEL$;
use App\Http\Requests\$MODEL$\$MODEL_REQUEST$;
use $MODEL_CLASS$;
use $MODEL_REQUEST_CLASS$;
use App\Actions\$MODEL$\Create$MODEL$;
use App\Actions\$MODEL$\Update$MODEL$;
use App\Actions\$MODEL$\Delete$MODEL$;
Expand Down

0 comments on commit 6e4c2ca

Please sign in to comment.