carbincreative / postmark
对 Laravel 4.x 路由类进行细微改进。
dev-master
2013-12-14 11:20 UTC
Requires
- php: >=5.4.4
This package is not auto-updated.
Last update: 2024-09-24 01:41:05 UTC
README
对 Laravel 4.x 路由类进行细微改进。增加了对 Route::alias
和 Route::redirect
的支持。
安装
将此存储库添加到您的 composer.json
文件中。
"reposotories": [
{
"type": "git",
"url": "https://github.com/CarbinCreative/Postmark.git"
}
]
别忘了在 composer.json
中添加您的依赖。
"require": [
"carbincreative/postmark": "dev-master"
]
最后一步,您需要将我们的 ServiceProvider 添加到 app/config/app.php
文件中。
'Postmark\PostmarkServiceProvider'
使用方法
就像您通常添加路由一样...
Route::get('hello-world', 'FooController@get');
Route::get('company/jobs', 'BarController@get');
现在,添加别名或重定向变得非常简单。
Route::alias('hejsan-varlden', 'hello-world');
Route::redirect('work-with-us', 'company/jobs');