how to specify which user gets deactivated in PHP, Laravel framework -
firstly have apologize if tittle off subject, wasn't finding better explanation it.
anyway, trying algorithm website checks if there 0 available projects @ client.
client(id: 1) can have infinite number of objects. client(id: 1) state active. if projects of client(id: 1) set inactive. client should set inactive too.
i tried enter algorithm in helpers.php like:
function checkclientaccounts(client $client, $action){ $activeprojects = project::all()->where('is_active', '1')->count(); if($activeprojects == 0){ $client->changeactivestate($action); }else{ //do nothing }
but not understanding initialize or how make of work. i've goodled past hour nothing, suggestion?
Comments
Post a Comment