Open gpluess opened 2 years ago
What's the best way to deal with Resource Controllers?
Since there is no Route::multilingualResource() at the moment, I've solved it like this.
Route::multilingualResource()
Before:
Route::resource('companies', \App\Http\Controllers\CompanyController::class)
After:
Route::multilingual('companies', [\App\Http\Controllers\CompanyController::class, 'index'])->name('companies.index'); Route::multilingual('companies/create', [\App\Http\Controllers\CompanyController::class, 'create'])->name('companies.create'); Route::multilingual('companies/{company}', [\App\Http\Controllers\CompanyController::class, 'show'])->name('companies.show'); Route::multilingual('companies/{company}/edit', [\App\Http\Controllers\CompanyController::class, 'edit'])->name('companies.edit'); Route::resource('companies', \App\Http\Controllers\CompanyController::class)->only([ 'store', 'update', 'destroy' ]);
Is there a better way to solve this?
Hey @gpluess,
I've missed the notification for this issue for some reasons. 🙈 There's no methods for resource controller at the moment but I'll definitely accept a pull request for this. 😄
What's the best way to deal with Resource Controllers?
Since there is no
Route::multilingualResource()
at the moment, I've solved it like this.Before:
After:
Is there a better way to solve this?