laravel api controller namespace code example
Example 1: Route::resource('/posts','PostController');
Route::resources([
'photos' => 'PhotoController',
'posts' => 'PostController',
]);
Example 2: laravel create resource controller
php artisan make:controller PhotoController --resource