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

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -