03.12.2015 Views

laravel4cookbook

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Access Control List 62<br />

16 {{ Form::submit("save") }}<br />

17 {{ Form::close() }}<br />

18 @stop<br />

19 @section("footer")<br />

20 @parent<br />

21 <br />

22 @stop<br />

.<br />

This file should be saved as app/views/group/edit.blade.php.<br />

We’ve modified the group/edit view to include the new assign views. If you try to edit a group, at<br />

this point, you might see an error. This is because we still need to pass the users and resources to<br />

the view…<br />

1 return View::make("group/edit", [<br />

2 "form" => $form,<br />

3 "group" => $group,<br />

4 "users" => User::all(),<br />

5 "resources" => Resource::where("secure", true)->get()<br />

6 ]);<br />

.<br />

This was extracted from app/controllers/GroupController.php.<br />

Seeding Resources<br />

We return all the users (so that any user can be in any group) and the resources that need to be<br />

secure. Right now, that database table is empty, but we can easily create a seeder for it:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!