F
Filament13mo ago
Itachi

How redirect to another resources page

->action( static function (Component $component,$data) {
// return redirect()->route('filament.auth.login',$data);
return redirect()->route('Filament/Resources/MaterialResource.php',$data);
});
->action( static function (Component $component,$data) {
// return redirect()->route('filament.auth.login',$data);
return redirect()->route('Filament/Resources/MaterialResource.php',$data);
});
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
Vp
Vp13mo ago
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
Itachi
ItachiOP13mo ago
Thank you,sir ji sir can you please help me in this
return redirect()->route('filament.resources.materials.index',$data)
return redirect()->route('filament.resources.materials.index',$data)
this is now work but how i get data form url in filament
Vp
Vp13mo ago
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)
Itachi
ItachiOP13mo ago
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
Vp
Vp13mo ago
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()
Itachi
ItachiOP13mo ago
Thank you sir can you tell me how uplode a video and play it
Vp
Vp13mo ago
No idea sir
S. Mert ÖZTÜRK
S. Mert ÖZTÜRK13mo ago
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'])
S. Mert ÖZTÜRK
S. Mert ÖZTÜRK13mo ago
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>
S. Mert ÖZTÜRK
S. Mert ÖZTÜRK13mo ago
* $state return to input value, you can modify here, maybe use special video player
Want results from more Discord servers?
Add your server