5 lines
501 B
PHP
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);
|