我需要一个 laravel routes.php 条目,该条目将捕获网站特定 domain/premium-section 的所有流量,以便我可以在访问高级内容之前提示人们成为会员.
I need a laravel routes.php entry that will catch all traffic to a specific domain/premium-section of the site so that I can prompt people to become members before accessing the premium content.
推荐答案但是没有任何匹配的方法,只是一个包罗万象的方法.
But there aren't any matching methods, just a catch-all. Route::group(['as' => 'premium-section::', 'prefix' => 'premium-section', 'middleware' => ['web']], function(){ Route::any('', 'PremiumSectionController@premiumContentIndex'); Route::controller('/', 'PremiumSectionController'); });
.
namespace AppHttpControllers; use ... class PremiumSectionController extends Controller{ public function premiumContentIndex(){ return 'no extra parameters'; } //magically gets called by laravel public function missingMethod($parameters = array()){ return $parameters; } }更多推荐
如何在 Laravel 中创建一条包罗万象的路线
发布评论