Closed timyourivh closed 9 months ago
Hello @timyourivh,
Thanks for your feedback ! I'd prefer adding this with full class path, that's what i'm used to see in most cases. If you find time, feel free to submit a PR, i also might be able to do this this week-end :)
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 theactions
andinstructions
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:
actions
andinstructions
methods to include the full class path.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
php artisan rest:resource TestResource
{projectroot}/app/Rest/Resources/TestResource.php
actions
andinstructions
methods and see the incorrect result.