I have route like this
Route::apiResource('article.comment', ArticleCommentController::class)->except('destroy', 'update');
Route::apiResource('article.comment', ArticleCommentController::class)->only('update')->withTrashed();
But, when I am check the routing using php artisan r:l, show error like this
BadMethodCallException
Method Illuminate\Routing\PendingResourceRegistration::withTrashed does not exist.
at D:\dev\api_app\vendor\laravel\framework\src\Illuminate\Macroable\Traits\Macroable.php:113
109▕ */
110▕ public function __call($method, $parameters)
111▕ {
112▕ if (! static::hasMacro($method)) {
➜ 113▕ throw new BadMethodCallException(sprintf(
114▕ 'Method %s::%s does not exist.', static::class, $method
115▕ ));
116▕ }
117▕
• Bad Method Call: Did you mean Illuminate\Routing\PendingResourceRegistration::withoutMiddleware() ?
1 D:\dev\api_app\routes\api.php:88
Illuminate\Routing\PendingResourceRegistration::__call("withTrashed", [])
2 D:\dev\api_app\vendor\laravel\framework\src\Illuminate\Routing\Router.php:423
Illuminate\Routing\RouteFileRegistrar::{closure}(Object(Illuminate\Routing\Router))
why, method ->withTrashed() can't add to route resource?