2
我有Laravel的混合和角路由問題,而試圖抓住我的非Laravel和航線目前斜視..FatalErrorException在Facade.php行216:調用未定義的方法照亮基金會應用::失蹤()
我得到了下面的錯誤,當我說我的應用程序缺少方法\ HTTP \ route.php:
FatalErrorException在Facade.php行216:調用未定義的方法照亮\基金會\應用:: missing()
我知道這會工作K罰款與laravel 5或下降版本,但不是與我目前正在使用的laravel 5.2,所以如何在laravel 5.2中編碼?任何解決方案
route.php樣子:
<?php // app/routes.php
// HOME PAGE ===================================
// I am not using Laravel Blade
// I will return a PHP file that will hold all of our Angular content
Route::get('/', function() {
View::make('index'); // will return app/views/index.php
});
// API ROUTES ==================================
Route::group(['prefix' => 'api'], function() {
// Angular will handle both of those forms
// this ensures that a user can't access api/create or api/edit when there's nothing there
Route::resource('comments', 'CommentController',
['only' => ['index', 'store', 'destroy']]);
});
// CATCH ALL ROUTE =============================
// all routes that are not home or api will be redirected to the frontend
// this allows angular to route them
App::missing(function($exception) {
return View::make('index');
});
由於它工作得很好......甚至我發現laracast通道此解決方案。感謝您的評論.. https://laracasts.com/discuss/channels/general-discussion/laravel-5-catch-all-route-appmissing-handle?page=1 – Himakar
是有同樣的問題,但實施此它現在工作正常。謝謝@ jedrzej.kurylo –
YEAH!你搖滾人!你搖滾!就是這個! –