So I was planning to do a type of form to edit the user's data. I am currently using laravel-8 and I am quite new to it. How do I edit the the data using forms and request can someone help out? I was planning to put the function in my Dashboard controller and the form to a blank page I will be working on. Here is the controller so far:
<?php
namespace App\Http\Controllers;
use App\Models\User;
use Auth;
use Illuminate\Http\Request;
class DashboardController extends Controller
{
public function dashboard()
{
$dashboardTitle = "Dashboard";
$isCurrent = "dashboard";
return view('dashboard.index', [
'dashboardTitle' => $dashboardTitle,
'isCurrent' => $isCurrent
]
);
}
public function profile()
{
$dashboardTitle = "Profile";
$isCurrent = "Profile";
return view('dashboard.profile', [
'dashboardTitle' => $dashboardTitle,
'isCurrent' => $isCurrent
]
);
}
public function directory()
{
$dashboardTitle = "Directory";
$isCurrent = "Directory";
$users = User::all();
return view('dashboard.directory', [
'dashboardTitle' => $dashboardTitle,
'isCurrent' => $isCurrent,
'users' => $users
]);
}
public function journal()
{
$dashboardTitle = "Journal";
$isCurrent = "Journal";
return view('dashboard.journal', [
'dashboardTitle' => $dashboardTitle,
'isCurrent' => $isCurrent
]
);
}
public function files()
{
$dashboardTitle = "Files";
$isCurrent = "Files";
return view('dashboard.files', [
'dashboardTitle' => $dashboardTitle,
'isCurrent' => $isCurrent
]
);
}
}
I wanted to put it in the profile function. Any help would be greatly appreciated :D