Using custom function in a form

I have a page where I have a form textarea, in the textarea I have all the ids divided by comma example: qIcTM8WXFjk,8X2kIfS6fb8

These ids are processed through a function of mine:

function processMultipleVideos($request)
{
    $all_id = explode(',', $request->id_video);

    foreach ($all_id as $value) {
        $all_idcode = Youtube::getVideoInfo($value);
        $all_id_de = json_encode($all_idcode);
        $video = new Video();
        $video->id_video = $all_idcode->id;
        $video->name= $all_idcode->snippet->title;
        $video->save();
    }
}


How can I tell Filamentphp to use this function to post data? Also, how do I add a button next to "New Video" in the header? In the documentation I find only references to how to add buttons in tables
Was this page helpful?