Call to undefined function routes() (View: C:\xampp\htdocs\Julmarice\framework\resources\views\soulfy\apages.blade.php)
Why this is undefine?
apages.blade.php
<form action="{{ routes('navcolor') }}" method="post">
<div style="color: white;">Select Pages Navigation Color :</div>
{{ csrf_field() }}
<select name="NavColor">
<option value="black">Black</option>
<option value="blue">Blue</option>
<option value="gray">Gray</option>
<option value="brown">Brown</option>
</select>
<input type="submit" value="Submit"><br><br>
</form>
routes.php
Route::post('/home/navcolor', 'SettingController@postNavColor')->name('navcolor');
SettingController.php
public function postNavColor(Request $request)
{
$domain = $_SERVER['SERVER_NAME'];
$user = User::where('domain', $domain)->first();
$user_id = $user->id;
$nav_color = $request->get('navcolor');
DB::table('user_profile')->where('user_id', $user_id)
->update(['nav_color' => $nav_color]);
return view('/soulfy/apages');
}