This is my code of index.blade.php I tried everything with `app()->getLocale() but unfortunately with no positive result. How can i fix it ?
<form action="{{ route('patients.destroy', $patient->id) }}" method="post" style="float: right;">
@csrf
@method('DELETE')
<button type="submit" style="border: 0; background: none; cursor: pointer;"><i class="fa fa-trash"></i></button>
</form>
Route::redirect('/', '/en');
Route::group(['prefix' => '{language}'], function() {
Route::get('/', function () {
return view('welcome');
});
Auth::routes();
Route::get('/home', 'HomeController@index')->name('home');
Route::resource('patients', 'PatientController');
Route::get('/search', 'PatientController@search');
});
Your route is expecting two params, and you passed only one so change your route as below.
Edit:-
For welcome blade you directly access the URL
<a href="{{ url('en') }}"
Or if you want to do it with route then you need to assign the name as below