Skip to content

Commit

Permalink
fix request generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Baptiste Loup committed Apr 25, 2024
1 parent a7edf14 commit b0954e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/CrudGeneratorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Ogrre\CrudGenerator;

use Illuminate\Console\Command;
use Illuminate\Contracts\Filesystem\FileNotFoundException;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Str;
Expand Down Expand Up @@ -219,6 +218,7 @@ protected function generateRequests($modelName, $attributes)

$requestTemplate = $this->files->get(__DIR__ . '/stubs/request.stub');
$requestTemplate = str_replace('{{className}}', $className, $requestTemplate);
$requestTemplate = str_replace('{{modelName}}', $modelName, $requestTemplate);
$requestTemplate = str_replace('{{rules}}', $formattedRules, $requestTemplate);

$modelPath = $requestsDirectory . "{$className}.php";
Expand Down
2 changes: 1 addition & 1 deletion src/stubs/request.stub
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App\Http\Requests;
namespace App\Http\Requests\{{modelName}};

use Illuminate\Foundation\Http\FormRequest;

Expand Down

0 comments on commit b0954e2

Please sign in to comment.