Route::get('user', array('before' => 'old', function() { return 'You are over 200 years old!'; }));
https://laravel.com/docs/4.2/routing#route-filters
Group ekekata wage daddi lesi neda hebei. But mata nm Laravel hoda framework ekak, fast learn, speed dev
මේ හුස්තා 2013 release උන Laravel 4 වල තිබ්බ filters ගැනද මේ 2021 Laravel 8 තියන කාලේ කියවන්නේ?Filter Classes
For advanced filtering, you may wish to use a class instead of a Closure. Since filter classes are resolved out of the application IoC Container, you will be able to utilize dependency injection in these filters for greater testability.
Registering A Class Based Filter
By default, the filter method on the FooFilter class will be called:PHP:Route::filter('foo', 'FooFilter');
If you do not wish to use the filter method, just specify another method:PHP:class FooFilter { public function filter() { // Filter logic... } }
PHP:Route::filter('foo', 'FooFilter@foo');
ඔය තියෙන්නේ documentation එකේම උත්තරේ.
middleware දැක්ක කාලෙකද අලුත් ත්රෙඩ් එකක් වැටෙයි.
