Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
hafijul233 committed Jul 6, 2024
2 parents 81ac378 + c27cb63 commit b65c89c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions config/crud.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
| command with default laravel commands. You can change it to `make:crud`
| Default is : 'laraflow:make-crud'
*/
'command' => "laraflow:make-crud",
'command' => 'laraflow:make-crud',

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -56,7 +56,7 @@
| {CONTROLLER} => full namespace controller path
|
*/
'route_template' => <<<HTML
'route_template' => <<<'HTML'
Route::apiResource('{RESOURCE_URI}', {CONTROLLER});
HTML,

Expand Down
16 changes: 8 additions & 8 deletions src/Commands/CrudMakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,25 +214,25 @@ private function updateRouteFile(): void
file_put_contents($filePath, $fileContent);
}

private function renderRouteTemplate():string
private function renderRouteTemplate(): string
{
$singleName = Str::kebab(basename($this->getResourceName()));

$resourceName = Str::plural($singleName);

$controller = GeneratorPath::convertPathToNamespace(
'\\'
. $this->getModuleName()
. '\\'
. GenerateConfigReader::read('controller')->getNamespace()
. '\\'
. $this->getResourceName()
. 'Controller::class'
.$this->getModuleName()
.'\\'
.GenerateConfigReader::read('controller')->getNamespace()
.'\\'
.$this->getResourceName()
.'Controller::class'
);

$layout = config('crud.route_template', "Route::apiResource('{RESOURCE_URI}', {CONTROLLER});\n");

$template = $layout . "\n\n //DO NOT REMOVE THIS LINE//\n";
$template = $layout."\n\n //DO NOT REMOVE THIS LINE//\n";

$replacements = [
'{RESOURCE_URI}' => $resourceName,
Expand Down

0 comments on commit b65c89c

Please sign in to comment.