DEV Community

mostafalaravel
mostafalaravel

Posted on

2 2

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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more