Hello folks, A beginner here.
I have been using cviebrock/eloquent-sluggable in my project.
Locally everything is working great! I can access links with the same routes and with slugs rather than IDs.
My Route:
Route::get('render_single_services/{slug}', [SingleController::class, 'render_single_services'])->name('render_single_services');
My Service Controller's Store Method has this. Ive used "use Sluggable;" and the other steps in the Model too.
$service->slug = SlugService::createSlug(Service::class, 'slug', $request->title);
My view -Controller
public function render_single_services(Request $request, $slug)
{
.......;
$service = Service::where("slug", $slug)->first();
$services = Service::all();
$remainingservices = Service::all()->except($service->id);
return view('portal.singleservice', compact('service', 'services', 'remainingservices'));
}
My View
<ul class="list-arrow">
@foreach ($services as $service )
<li><a href="{{ route('render_single_services', $service->slug) }}">{{ $service->title }}</a></li>
@endforeach
</ul>
Can anyone tell me why it works locally but as soon as I upload it on Cpanel.. It throws me this error? I would love to know what I have been missing. I'm sorry I read the other threads before asking this here but I still am confused.