I am trying to create a snippet file after the app is installed. I am using Osiset package of laravel to run the api. Now the issue is when file have 2-3 lines code then using API file get created and if the file have a form or javascript code then it is not creating.
Here is the code I am using to create a file:
$param = [
'asset'=>[
"key" => "snippets/contact-form.liquid",
"value" => view('contact-form')->render()
]
];
$request2 = $shop->api()->rest('PUT', '/admin/api/2022-10/themes/'.$request['body']['container']['themes'][0]['id'].'/assets.json',$param);
echo "
";print_r($request2);echo "
";
No error/waring appears on the screen. All I see is the blank screen. But in the console after some time I saw an error messages
Please help me get this fixed.
Thanks