platform
platform copied to clipboard
Show uploaded files in edit form
Is your feature request related to a problem? Please describe. I am using Orchid crud that includes an upload field. The uploaded file is video and I am trying to render the file within HTML video player. But I couldn't see any way to do it so far.
Describe the solution you'd like Orchid should allow creating custom HTML elements easily. Something like:
return [
Input::make('title'),
HTML::make('video')->render(function ($model) {
return view('partials.video', ['video' => $model]);
}),
];
Describe alternatives you've considered I tried using Layout to embed HTML in a form (fields function in the resource file of orchid crud). but there is an error. I couldn't find any other way to accomplish this within Orchid crud.
Additional context I am using Orchid crud.
Hi, does the existing class ViewField not solve your problem?
Thank @tabuna that is exactly what I am looking for. I tried finding documentation for it but found nothing. So far I am able to inject the view but unable to pass any variable to it. How do I pass the model to the view for showing already added content?
ViewField::make('video')->view('partials.video'),