Skip to content
Advertisement

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/34512#discussioncomment-564416

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 components: BeforeRequest: starts a trace OnRequest: call event listener which listened

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 code below. The function Auth::check

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 request validator class). After validating the data you can add additional data

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 : what

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 the records in the list

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 it

Advertisement