通过本地服务器加载Laravel时出现意外的文件错误结束。在我的路线中,我有:
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::post('/item/create', ['as' => 'item.store', 'uses' => 'ItemController@store']);
Route::resource('item', 'ItemController');
Route::get('/', function() {
return view('welcome');
});
Route::auth();
Route::get('/home', 'HomeController@index');
Route::post('/item', 'ItemController@store');
Route::get('/item', 'ItemController@index');
Route::get('/item/{id}', 'ItemController@show');
Route::group(['middleware' => ['web']], function(){
Route::get('/addItem/{productID}', 'CartController@addItem');
Route::get('/removeItem/{productID}', 'CartController@removeItem');
Route::get('/checkout', function() {
return view('cart.checkout');
});
Route::post('/create_payment', function(){
// Set your secret key: remember to change this to your live secret key in production
// See your keys here https://dashboard.stripe.com/account/apikeys
\Stripe\Stripe::setApiKey("sk_test_VVSBY8xjNklioi7V0yFVfx6Q");
$receiver = \Stripe\BitcoinReceiver::create(array(
"amount" => 1000, // amount in cents
"currency" => "usd", // presently can only be USD
"email" => "payinguser+fill_now@example.com"
));
$charge = \Stripe\Charge::create(array(
"amount" => $receiver->amount,
"currency" => $receiver->currency,
"source" => $receiver->id,
"description" => "Example charge"
));
});
Route::get('/logout', 'Auth\AuthController@getLogout');
// Registration routes...
Route::get('/register', 'Auth\AuthController@getRegister');
Route::post('/register', 'Auth\AuthController@postRegister');
});
//Route
在我的欢迎模板中,我有这个:
@extends('layouts.app')
@section('content')
<div class="container">
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div class="panel panel-default">
<div class="panel-heading">Welcome</div>
<div class="panel-body">
Your Application's Landing Page.
</div>
</div>
</div>
</div>
</div>
@endsection
Laravel报告文件意外结束的错误。我不明白为什么会这样。据我所知,我的刀片文件是准确的,但由于某种原因,它不会呈现欢迎页面。
答案 0 :(得分:2)
我弄明白了这个问题。我想使用@extends('add')而不是layout.app。现在一切都有效。