i am trying to get the insert callback to work in the same laravel controller but i cant do it this is my code can this be done?
class VehicleRegisterController extends Controller
{
public function index()
{
$xcrud = Xcrud_get_instance();
$xcrud->table("vehicles");
$xcrud->before_insert("insert_payments", route('vehicles'));
function insert_payments($postdata, $xcrud){
$patent = $postdata->get('patent');
}
$render = $xcrud->render();
}
}
class VehicleRegisterController extends Controller
{
public function index()
{
$xcrud = Xcrud_get_instance();
$xcrud->table("vehicles");
$xcrud->before_insert("insert_payments", route('vehicles'));
function insert_payments($postdata, $xcrud){
$patent = $postdata->get('patent');
}
$render = $xcrud->render();
}
}