DEV Community

mostafalaravel
mostafalaravel

Posted on

 

Laravel how to apply a validation on a json_decode content ?

Hello , I receive the form data via as a blob type

$companyDetail = request()->file('companyDetail');
$companyDetailJson = json_decode($companyDetail->getContent(),true);
Enter fullscreen mode Exit fullscreen mode

How to apply a validation on $companyDetailJson ?

For example how to make : $companyDetailJson ["director"]["name"] required ?

Thanks

Top comments (0)

Timeless DEV post...

Git Concepts I Wish I Knew Years Ago

The most used technology by developers is not Javascript.

It's not Python or HTML.

It hardly even gets mentioned in interviews or listed as a pre-requisite for jobs.

I'm talking about Git and version control of course.

One does not simply learn git