スタックで検索したところ、この質問が表示されましたLaravelのコントローラーにフィルターパラメーターを追加する方法は? .
同様の質問がありますが、今回は柔軟な $myparam 引数を渡す必要があります。コードは次のようになります。
Route.php 内
Route::filter('diffauthor',function($myparam){
if(Authority::cannot('edit', 'postedit', $myparam))
return View::make('permdeny.index');
});
そしてコントローラーで:
public function __construct() {
parent::__construct();
$this->filter('before','diffauthor', $myparam);
}
ユーザーの要求に基づいて $myparam ベースを渡すにはどうすればよいですか?