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…
Tag: laravel-8
Laravel 8 – Listen to eloquent events made during a specific request
Currently, I’m trying to wire a telemetry library (OpenTelemetry php lib) to the Laravel event model. The idea is to forward traces to a third party service. A single trace consistents of a request and all database calls that have been made during the request. I’ve created three middleware compone…
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 :…
How to change value from select dropdown in database
i want to change value from my dropdown but i’m begginer and i’m little lost. This is my Controller method: This is my dropdown in vuejs file: and this is my method in vue js: the route is fine, the problem are probably my methods. Answer I think you should pass right values to your onChanges meth…
after deployment In Heroku Insert user not working
I made a normal CRUD app with Laravel 8 , it was working fine in my local machine , but when i deployed it on Heroku , and tried to Insert a user it gives me this error : everything else (editing, updating, Deleting) seems to be working just fine it also seem to highlight this ligne in my controller
How to use model equilevent normal php file => file.php without blade
If status is successful how do I use model in normal php file without using blade.If you can help with this issue, I’m very home. When the file is a blade, it cannot be accessed from outside. i need to store it in php extension.Because this file asynchronously receives post array from outside Model File…
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 …