03.12.2015 Views

laravel4cookbook

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Access Control List 70<br />

.<br />

This was extracted from app/start/global.php.<br />

Once we’ve included that helpers.php file in the startup processes of our application; we can check<br />

whether the authenticated user is allowed access to resources simply by passing the resource name<br />

to the allowed() method.<br />

.<br />

The first time you run the migrations (if you’re installing from GitHub); you may see errors relating<br />

to the resource table. This is likely caused by the routes.php file trying to load routes from an empty<br />

database table before seeding takes place. Try commenting out the code in routes.php until you’ve<br />

successfully migrated and seeded your database. There are nicer ways to do this; all of which I will<br />

not cover now.<br />

Try this out by wrapping the links of your application in a condition which references this method.<br />

.<br />

For the sake of brevity; I have not included any examples of this, though many can be found, in<br />

the source code, on GitHub.

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

Saved successfully!

Ooh no, something went wrong!