Skip to content

Commit 9b456d1

Browse files
committed
Publish form request stub.
Based on laravel/framework@f5b6f3b Signed-off-by: Mior Muhammad Zaki <[email protected]>
1 parent 52f4984 commit 9b456d1

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

src/Commands/Request.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ public function getStubFile(): string
3333
return __DIR__.'/../../storage/laravel/request.stub';
3434
}
3535

36+
/**
37+
* Get the stub file for the generator.
38+
*/
39+
public function getPublishedStubFileName(): ?string
40+
{
41+
return 'request.stub';
42+
}
43+
3644
/**
3745
* Get the default namespace for the class.
3846
*/

src/Commands/StubPublish.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
5757
\realpath(__DIR__.'/../../storage/job/job.stub') => $stubsPath.'/job.stub',
5858
\realpath(__DIR__.'/../../storage/database/eloquent/model.pivot.stub') => $stubsPath.'/model.pivot.stub',
5959
\realpath(__DIR__.'/../../storage/database/eloquent/model.stub') => $stubsPath.'/model.stub',
60+
\realpath(__DIR__.'/../../storage/laravel/request.stub') => $stubsPath.'/request.stub',
6061
$this->getFeatureTestStubFile() => $stubsPath.'/test.stub',
6162
\realpath(__DIR__.'/../../storage/testing/test.unit.stub') => $stubsPath.'/test.unit.stub',
6263
\realpath(__DIR__.'/../../storage/database/migrations/migration.create.stub') => $stubsPath.'/migration.create.stub',

storage/laravel/request.stub

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

3-
namespace DummyNamespace;
3+
namespace {{ namespace }};
44

55
use Illuminate\Foundation\Http\FormRequest;
66

7-
class DummyClass extends FormRequest
7+
class {{ class }} extends FormRequest
88
{
99
/**
1010
* Determine if the user is authorized to make this request.

0 commit comments

Comments
 (0)