xxxxxxxxxx
<?php
namespace App\Http\Controllers;
use App\Models\User;
use Illuminate\View\View;
class UserController extends Controller
{
/**
* Show the profile for a given user.
*/
public function show(string $id): View
{
return view('user.profile', [
'user' => User::findOrFail($id)
]);
}
}
xxxxxxxxxx
php artisan make:controller Api/UserController --model=User --resource --requests
xxxxxxxxxx
//i want to create dashboard controller
php artisan make:controller DashboardController
// if i want to create resourse controller then
php artisan make:controller Dashboardcontroller -r
//and also with
php artisan make:controller Dashboardcontroller --resource
xxxxxxxxxx
//open your terminal and type
php artisan make:controller yourprojectfolder/LaravelController --resource
xxxxxxxxxx
php artisan make:controller BookController --resource --model=Book