日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程语言 > php >内容正文

php

app http routes.php,Laravel:我的应用程序没有被路由(Laravel : My app doesn't get routed)

發(fā)布時(shí)間:2023/12/2 php 40 豆豆
生活随笔 收集整理的這篇文章主要介紹了 app http routes.php,Laravel:我的应用程序没有被路由(Laravel : My app doesn't get routed) 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

Laravel:我的應(yīng)用程序沒有被路由(Laravel : My app doesn't get routed)

我正在運(yùn)行我的第一個(gè)laravel應(yīng)用程序,在接下來的幾個(gè)小時(shí)中遇到依賴項(xiàng)安裝錯(cuò)誤。

對不起它可能是一個(gè)小錯(cuò)誤,但似乎我無法找到。

圖片較暗,電腦壞了。

應(yīng)用程序/ HTTP / routes.php文件

// view('helloworld') ==> helloworld.blade.php

Route::get('/', function () {

return view('helloworld');

});

資源/視圖/ helloworld.blade.php

Yo test....test..

當(dāng)我點(diǎn)擊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

更新時(shí)間:2019-12-04 02:15

最滿意答案

在Laravel 5.3中,Http路由文件被切換到routes /目錄。

所有Laravel路由都在路由文件中定義,這些路由文件位于routes目錄中。 這些文件由框架自動加載。 routes / web.php文件定義了適用于您的Web界面的路由。 這些路由分配了Web中間件組,該組提供會話狀態(tài)和CSRF保護(hù)等功能。 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');

相應(yīng)的控制器可能是這樣的: class HomeController extends BaseController {

public

...

很久以來我使用Heroku,但文檔已經(jīng)滿足您的需求。 你得到的是403,因?yàn)楹芸赡苣銢]有設(shè)置web root。 默認(rèn)情況下,Web根目錄是/受限制的。 在Laravel你需要它/public 將Procfile添加到Laravel項(xiàng)目的根目錄并向其添加以下行: web: vendor/bin/heroku-php-apache2 public/ 問題的第二部分可以通過從終端運(yùn)行heroku run bash來實(shí)現(xiàn)。 您可能需要指定您的應(yīng)用名稱。 但是應(yīng)該提到的是,下次部署應(yīng)用程序時(shí),您的更改可能會

...

在Laravel 5.3中,Http路由文件被切換到routes /目錄。 https://laravel.com/docs/5.3/routing#basic-routing 所有Laravel路由都在路由文件中定義,這些路由文件位于routes目錄中。 這些文件由框架自動加載。 routes / web.php文件定義了適用于您的Web界面的路由。 這些路由分配了Web中間件組,該組提供會話狀態(tài)和CSRF保護(hù)等功能。 routes / api.php中的路由是無狀態(tài)的,并被分配了api中間件組

...

您可以為每個(gè)子域創(chuàng)建路由組,然后對每個(gè)組使用“之前”過濾器。 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

...

使用 :

你得到一個(gè)錯(cuò)誤,因?yàn)槟銓戝e(cuò)了:

Use :

You get an error because you made a typo:

在@Panama_Jack的幫助下,我能夠找到正確的方向來解決這個(gè)問題。 訣竅是: 我正在運(yùn)行Laravel并使用php -S 0.0.0.0:80來運(yùn)行我的開發(fā)服務(wù)器 PHP的內(nèi)部服務(wù)器不解析.htaccess文件 但是,它確實(shí)有一些默認(rèn)路由。 有一個(gè)很大的已知擴(kuò)展名列表( .js , .css , .mp3等) - 如果請求有這些擴(kuò)展名之一,它會嘗試加載文件。 如果請求沒有這些可信擴(kuò)展之一,則會將其重定向到index.php 但是,您可以使用以下命令運(yùn)行服務(wù)器: 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是一個(gè)功能組件,因此無法訪問this關(guān)鍵字,您需要像訪問功能參數(shù)那樣訪問道具 export const AuthenticatedFrame = (props) => (

{props.children}

...

我相信你想:

如果您查看瀏覽器屏幕截圖中的網(wǎng)址,您會看到

收益率: https://kidznotes-app-cynthiarios.c9users.io/classrooms#new

但你想要: https://kidznotes-app-

...

您使用的是哪個(gè)版本的PHP buildpack? 您可以通過使用-b https://github.com/cloudfoundry/php-buildpack選項(xiàng)推送您的應(yīng)用程序,嘗試使用最新的社區(qū)版本。 我知道使用早期版本的buildpack(v3.1.0),您實(shí)際上需要在一個(gè)文件中指定一個(gè)名為COMPOSER_VERSION的特殊屬性,該文件與您的應(yīng)用程序一起推送,名為options.json options.json示例: {

"PHP_EXTENSIONS": [ "bz2", "z

...

總結(jié)

以上是生活随笔為你收集整理的app http routes.php,Laravel:我的应用程序没有被路由(Laravel : My app doesn't get routed)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。