How to post null values on event creation

Hi all,

I’m using dhtmlxScheduler with Laravel and when I create a new event, I want to post an attribute like ‘project_id’ which is null. All works fine except for saving the new event in the database because null gets transformed into a string like ‘null’.

In the post request you can see that the posted value is actually null:

1511604105539_project_id:null

But this is the generated query:

insert into events (start_date, end_date, text, desc, user_id, project_id, task_id, color, updated_at, created_at) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)’, array(‘2017-11-23 09:00’, ‘2017-11-24 10:50’, 'New task, ‘Description here’, ‘8’, ‘null’, ‘null’, ‘#B3C1E5’, ‘2017-11-25 11:01:52’, ‘2017-11-25 11:01:52’)

Because I’m using foreign keys, Laravel throws an error because there obviously is no project with an id of ‘null’.

Is there some way inside the PHPLaravelDBDataWrapper class I actually can make a value null instead of a string ‘null’. Or is there some way I can turn off foreign key checks, like:

DB::statement(‘SET FOREIGN_KEY_CHECKS=0;’);

Thanks!

Michael