-
-
Notifications
You must be signed in to change notification settings - Fork 31
Closed
Description
Laravel Rest Api Version
1.1
Laravel Version
10.10
PHP Version
8.2
Database Driver & Version
MySQL 8.1.0 on Windows 10 Pro (x64)
Description
When generating a resource using the php artisan rest:resource {name} command it will generate a resource class but generates the actions and instructions methods with an incorrectly namespaced class. This class is not used/imported into the resource class by default, which results in an Exception and intelisense errors:
What it should look like:
To fix this I can see 2 possible solutions:
- Fix the classes on the
actionsandinstructionsmethods to include the full class path. - Import the class into the file (
use \Lomkit\Rest\Http\Requests\RestRequest;) and remove the full path from the other methods.
I noticed you prefer to include the complete path so I may create a PR applying solution 1 if allowed.
Steps To Reproduce
- Install lomkit/laravel-rest-api^1.1
- Run command
php artisan rest:resource TestResource - Inspect the generated file, should be located at
{projectroot}/app/Rest/Resources/TestResource.php - Scroll down to the
actionsandinstructionsmethods and see the incorrect result.
Metadata
Metadata
Assignees
Labels
No labels

