Last Updated: February 25, 2016
·
828
· crynobone

Routing events with Orchestra Platform 2.1

How can you make widget and placeholder generation efficient in Orchestra Platform?

This is something that I been considering for a while on Orchestra Platform, it been a nice experience when we have app booting callbacks, filters, view composers events which we can listen to but it somehow hard to dispatch an events based on current routing (or a wildcard).

This is now solved in 2.1 (which is scheduled to be released next January), you can now just do both of the following:

<?php use Orchestra\App; ?>
<a href="{{ App::handles('orchestra::users') }}" class="{{ App::is('orchestra::users') ? 'active': '' }}">
    Users
</a>

Alternatively you could automatically fire an event if certain route is matched:

<?php

Orchestra\App::when('orchestra::users', function () {
    Log::info("I'm on the users route");
});

1 Response
Add your response

great work.

over 1 year ago ·