我希望在我的routes.php文件中使用Mobile Detect。我已经将该软件包添加为composer.json中的要求,并安装在vendor文件夹中。现在我该如何使用它?
我尝试了这个答案,但没有成功,因为找不到该类:Laravel 4 using vendor classes。
我尝试了这个答案,但没有成功,因为找不到该类:Laravel 4 using vendor classes。
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"laravel/framework": "4.2.*",
"mobiledetect/mobiledetectlib": "*"
},
"autoload": {
"classmap": [
"app/commands",
"app/controllers",
"app/models",
"app/database/migrations",
"app/database/seeds",
"app/tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
},
"minimum-stability": "stable"
}
编辑:我尝试使用这个:https://github.com/jenssegers/Laravel-Agent,但是别名从未起作用,显示找不到该类。
php artisan dump-autoload
,composer dump-autoload
或者php composer.phar dump-autoload
吗? - Sam