How redirect to another resources page
when i click on submit button i want it redirect to Filament/Resources/MaterialREsource.php file but donot use any controller and function
how can i do this
10 Replies
check your route name using
route:list
and provide the route name in redirect(route('your.route.name'))
The route name should be like filament.admin.resources.materials.index
Thank you,sir ji
sir can you please help me in this
this is now work but how i get data form url in filament
You need to pass in as array like this
return redirect()->route('filament.resources.materials.index', ['data' => $data])
but what is $data
and what is the use case (just curious because you're redirecting to list page)i just try to redirect other resources page their is nothing on data i just check it work on not if i want to send data
Ok, I check more and I think this is better https://filamentphp.com/docs/3.x/panels/resources/getting-started#generating-urls-to-resource-pages you can easily called like
MaterialResource::getUrl()
Thank you
sir can you tell me how uplode a video and play it
No idea sir
you can use file upload for video upload;
https://filamentphp.com/docs/3.x/forms/fields/file-upload
* for only videos ->acceptedFileTypes(['video/x-ms-asf'],['video/x-flv'],['video/mp4'],['application/x-mpegURL'],['video/MP2T'],['video/3gpp'],['video/quicktime'],['video/x-msvideo'],['video/x-ms-wmv'],['video/avi'])
And for view, you can use custom entries;
https://filamentphp.com/docs/3.x/infolists/entries/custom
in your view page;
ViewEntry::make('video')
->view('filament.infolists.entries.video-show')
php artisan make:infolist-entry VideoShow
It will create a view file at resources/views/filament/infolists/entries/video-show.blade.php
and in this view;
<div>
<video width="320" height="240" controls>
<source src="{{ $getState() }}" type="video/mp4">
</video>
</div>
* $state return to input value, you can modify here, maybe use special video player