I have an admin panel which enables admins to assign different permissions to a user. The way that I do this is through tick boxes and when ticked it should assign a 1 to that permission.
The only problem is, the permissions are dynamic and so needs to go through a loop. I've had some trouble trying to grasp how I would got about assigning permissions this way as in my guess needs to loop through an array and then place the values into another array.
Does anyone know how I would go about this?
I have tried things like...
$park = Input::get('parks');
$permissions = array();
for($i = 0; $i < count($park); $i++)
{
$permissions = $park[$i] => 1;
}
Or...
$park = Input::get('parks');
for($i = 0; $i < count($park); $i++)
{
$park[$i] => 1;
}
Obviously the first one comes up with errors, but the second one will just come out as [1,1,1,1] .
Any help would be appreciated.