Vagrant & Laravel: storage/sessions permission denied


Hi there!
Exploring Vagrant (awesome tool!) and recently used to me Laravel Framework I got a problem with new host created at my vagrant VMachine:

Permission denied to app/storage/sessions

At your vagrant file just add:

config.vm.synced_folder ".", "/vagrant", :mount_options => ["dmode=777","fmode=666"]

Just halt and up again your vagrant machine and it’s done!

Undefined index: role_id at BjyAuthorize


Strange error around here:

 PHP Notice:  Undefined index: role_id in /var/www/site/vendor/bjyoungblood/bjy-authorize/src/BjyAuthorize/Provider/Role/ZendDb.php on line 90


It seems that SQL script creates user_role table with userId field but, at php module is requested role_id… just change column name and it’s fine!

Hope it helps!

Zend Framework 2: Use Different Layout Templates for each module


Hi there! Having different modules (like: default application module and CustomModule1) I had trouble setting different html layouts to them!

The solution is edit your module’s bootstrap like this:

public function onBootstrap(MvcEvent $e)
// You may not need to do this if you’re doing it elsewhere in your
// application
$eventManager = $e->getApplication()->getEventManager();
$moduleRouteListener = new ModuleRouteListener();

$sharedEventManager = $eventManager->getSharedManager(); // The shared event manager
$sharedEventManager->attach(__NAMESPACE__, MvcEvent::EVENT_DISPATCH, function ($e) {
$controller = $e->getTarget(); // The controller which is dispatched
$controllerName = $controller->getEvent()
if (!in_array($controllerName,
) {

please do not forget to include the template at templates path at module.config.php

‘view_manager’ => array(
‘template_map’=> array(
‘layout/layoutadm’ => __DIR__ . ‘/../view/layout/layoutadm.phtml’,

Hope it helps!