Files
Investidor-V2/outputs/investmoz-referencias-economicas-QA-20261016/inspect-business-drafts.php
T
nala 2d23157e40
tests / ci (push) Canceled after 0s
versao nrgocios
2026-10-16 13:06:58 +02:00

5 lines
501 B
PHP

<?php
require __DIR__.'/boot-QA.php';$result=[];
foreach(App\Models\ExistingBusiness::where('status','draft')->get()as$b){$readable=false;try{$payload=$b->payload;$readable=is_array($payload)&&!empty($payload['title']);}catch(Throwable){}$allowed=[];foreach([2,21]as$id)if(Illuminate\Support\Facades\Gate::forUser(App\Models\User::find($id))->allows('update',$b))$allowed[]=$id;$result[]=['id'=>$b->id,'owner'=>$b->owner_user_id,'readable'=>$readable,'allowed'=>$allowed];}
echo json_encode($result);