Thank you for the simplified simplified file upload functionality. Well explained.
@programmingfields4 ай бұрын
@@drishti5450 Thank you for your valuable feedback. This means a lot to me.
@WiseDev-u3z3 ай бұрын
I am encountering an issue with file uploads in the FilamentPHP Admin Panel. Whenever I try to add a file, such as an image or a video, I receive a "401 Unauthorized" error, but this only occurs in the production environment. I've tried various solutions I found on Google, but unfortunately, none of them have worked, including changes to some Nginx configurations and other adjustments. Could you please help me resolve this issue? Thank you!
@programmingfields3 ай бұрын
@WiseDev-u3z there can be multiple reasons for this. Either it can be a CSRF token mismatch issue, middleware issues, or sometimes it can be the server configuration thing like Niginx or Apache. You will have to make sure for the other POST route apart from the file upload.
@SameerGurung19753 ай бұрын
how do i make a reusable file upload livewire component that can be used in other blade views. For example I might have a create post view where i want to use the file upload component to allow the user to upload multiple images for the post
@programmingfields3 ай бұрын
@SameerGurung1975 To create a reusable file upload component in Livewire, follow these steps: 1. Generate the Livewire Component 2. Add File Upload Logic 3. Create the Blade View: 4. Render the Component in Other Views To reuse the file upload component, simply include it in any Blade view where you want to enable file uploads (e.g., your "Create Post" view). Just like this - @csrf Create Post
@SameerGurung19753 ай бұрын
@programmingfields thank you...i had thought of this approach. But the issue here is the livewire file upload component has a form which will be rendered inside the form in the blade view. This results in a nested form situation. Also when the blade view form is submitted the inner livewire component form for file upload will not save the images
@programmingfields3 ай бұрын
@@SameerGurung1975 In this case, you will have to avoid nesting forms. So you don't need the form in the file upload component. You will have to handle it in the parent component itself. That means you will have to trigger file upload through events which will be handled in the parent component's form.