Skip to content

Tag: laravel-8

how to resolve Redirection in laravel8?

The route is not redirecting the specified route in laravel8. Here is my code that is defined in web.php: After hitting ‘/’, I need to redirect to this route: I was getting an error: How to resolve this? Answer Try this to clear the cache: Refs: https://github.com/laravel/framework/discussions/345…

Hiding redudant link in Laravel 8

I want to hide link And if I logged out and in web.php ,i hide route with middlewares (e.g authsanctum and verified): .. but the Route::has() is still ‘true’ What to use instead of route has for hiding links while logged out? Answer You can conditionally load HTML in blade based on login with the …

how to add data to validated request input bag

I need to add custom data to the request input array from my customRequest class I tried this way It’s do the trick with request()->all() but when I returned $request->validated() it’s not exist. how can I do it? Answer $request->validated() is returning only validated data (data in the r…

Why does uploaded images disapear after deployment?

I deployed a project made in Laravel 8 with Heroku , it was working fine , but after some time , the images disapeared, and the file where i store them doesn’t show : and made me upload them again , that problem happened multiple times since yesterday , that’s the code i used to store the images :…

Configuration observer in Laravel

I am beginner in Laravel. I use in my project Laravel 8. I have this code: Controller Model Observer ServiceProvider I have 2 questions / problems: How can I disable following in the controller (index method)? I only need to record the moment when someone opens one record for editing, and does not list all th…

Return S3 private file as stream

I’m currently working on a route for a project that I need to get a specific file from S3, read its content, and return as a binary. I can’t just use the S3 file url, because it is private and it is intentional (we just don’t want the bucket files open). But the problem is, I want to stream …