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");
});
Written by Mior Muhammad Zaki
Related protips
1 Response
great work.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Orchestra-platform
Authors
Related Tags
#orchestra-platform
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#