app http routes.php,Laravel:我的应用程序没有被路由(Laravel : My app doesn't get routed)
Laravel:我的應用程序沒有被路由(Laravel : My app doesn't get routed)
我正在運行我的第一個laravel應用程序,在接下來的幾個小時中遇到依賴項安裝錯誤。
對不起它可能是一個小錯誤,但似乎我無法找到。
圖片較暗,電腦壞了。
應用程序/ HTTP / routes.php文件
// view('helloworld') ==> helloworld.blade.php
Route::get('/', function () {
return view('helloworld');
});
資源/視圖/ helloworld.blade.php
Yo test....test..
當我點擊http://localhost:8000/ ,它會讓我(即使刷新后):
為什么'/'不會被路由? 它是laravel 5,最新的。
I'm running my first laravel app for the first after hours struggling with dependencies installation errors.
Sorry it might be tiny mistake but seems I couldn't find out.
Picture are darker, computer is being broken.
app/Http/routes.php
// view('helloworld') ==> helloworld.blade.php
Route::get('/', function () {
return view('helloworld');
});
resources/view/helloworld.blade.php
Yo test....test..
when I hit http://localhost:8000/, it gaves me (even after refreshing) :
Why doesn't '/' get routed ? It's laravel 5, the latest one.
原文:https://stackoverflow.com/questions/41494569
更新時間:2019-12-04 02:15
最滿意答案
在Laravel 5.3中,Http路由文件被切換到routes /目錄。
所有Laravel路由都在路由文件中定義,這些路由文件位于routes目錄中。 這些文件由框架自動加載。 routes / web.php文件定義了適用于您的Web界面的路由。 這些路由分配了Web中間件組,該組提供會話狀態(tài)和CSRF保護等功能。 routes / api.php中的路由是無狀態(tài)的,并被分配了api中間件組。
In Laravel 5.3, the Http routes file was switched to the routes/ directory.
All Laravel routes are defined in your route files, which are located in the routes directory. These files are automatically loaded by the framework. The routes/web.php file defines routes that are for your web interface. These routes are assigned the web middleware group, which provides features like session state and CSRF protection. The routes in routes/api.php are stateless and are assigned the api middleware group.
2017-01-05
相關(guān)問答
這不是分頁,它只是一條路線。 你的路線是這樣的: Route::get('/', 'HomeController@showIndex');
Route::get('/about', 'HomeController@showAbout');
Route::get('/portfolio', 'HomeController@showPortfolio');
相應的控制器可能是這樣的: class HomeController extends BaseController {
public
...
很久以來我使用Heroku,但文檔已經(jīng)滿足您的需求。 你得到的是403,因為很可能你沒有設(shè)置web root。 默認情況下,Web根目錄是/受限制的。 在Laravel你需要它/public 將Procfile添加到Laravel項目的根目錄并向其添加以下行: web: vendor/bin/heroku-php-apache2 public/ 問題的第二部分可以通過從終端運行heroku run bash來實現(xiàn)。 您可能需要指定您的應用名稱。 但是應該提到的是,下次部署應用程序時,您的更改可能會
...
在Laravel 5.3中,Http路由文件被切換到routes /目錄。 https://laravel.com/docs/5.3/routing#basic-routing 所有Laravel路由都在路由文件中定義,這些路由文件位于routes目錄中。 這些文件由框架自動加載。 routes / web.php文件定義了適用于您的Web界面的路由。 這些路由分配了Web中間件組,該組提供會話狀態(tài)和CSRF保護等功能。 routes / api.php中的路由是無狀態(tài)的,并被分配了api中間件組
...
您可以為每個子域創(chuàng)建路由組,然后對每個組使用“之前”過濾器。 Route::filter('domain1', function($request)
{
$uri = Request::path(); //this might be in $request
$matches = preg_match('^https?:\/\/([a-zA-Z)]+)\./', $uri);
$subdomain = $matches[1];
Session::put('domain
...
使用 :
你得到一個錯誤,因為你寫錯了:
Use :
You get an error because you made a typo:
在@Panama_Jack的幫助下,我能夠找到正確的方向來解決這個問題。 訣竅是: 我正在運行Laravel并使用php -S 0.0.0.0:80來運行我的開發(fā)服務器 PHP的內(nèi)部服務器不解析.htaccess文件 但是,它確實有一些默認路由。 有一個很大的已知擴展名列表( .js , .css , .mp3等) - 如果請求有這些擴展名之一,它會嘗試加載文件。 如果請求沒有這些可信擴展之一,則會將其重定向到index.php 但是,您可以使用以下命令運行服務器: php -S 0.0.0.0:
...
根據(jù)Laravel官方文件, You may also use the prefix parameter to specify common parameters for your grouped routes:
Route::group(['prefix' => 'accounts/{account_id}'], function () {
Route::get('detail', function ($account_id) {
// Matches The a
...
AuthenticatedFrame是一個功能組件,因此無法訪問this關(guān)鍵字,您需要像訪問功能參數(shù)那樣訪問道具 export const AuthenticatedFrame = (props) => (
{props.children}
...
我相信你想:
如果您查看瀏覽器屏幕截圖中的網(wǎng)址,您會看到
收益率: https://kidznotes-app-cynthiarios.c9users.io/classrooms#new
但你想要: https://kidznotes-app-
...
您使用的是哪個版本的PHP buildpack? 您可以通過使用-b https://github.com/cloudfoundry/php-buildpack選項推送您的應用程序,嘗試使用最新的社區(qū)版本。 我知道使用早期版本的buildpack(v3.1.0),您實際上需要在一個文件中指定一個名為COMPOSER_VERSION的特殊屬性,該文件與您的應用程序一起推送,名為options.json options.json示例: {
"PHP_EXTENSIONS": [ "bz2", "z
...
總結(jié)
以上是生活随笔為你收集整理的app http routes.php,Laravel:我的应用程序没有被路由(Laravel : My app doesn't get routed)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 鹦鹉名字可爱洋气176个
- 下一篇: 电脑修主板后蓝屏了怎么办(电脑主板蓝屏维