mercredi 11 mai 2016

Laravel - unexpected end of file

I get a 'unexpected end of file error when loading Laravel through a local server. In my routes I have:

    <?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 http://ift.tt/1rnQsJq
        \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

and in my welcome template I have this:

@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 reports an error of an unexpected end of file. I don't understand why this is happening. As far as I know my blade files are accurate, but for some reason it won't render the welcome page.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire