创建CRUD应用程序时的Laravel错误页面

Following code in create.blade.php in the view->tasks->create.blade.php

@extends('layouts.master')

@section('content')

<h1>Add a New Task</h1>
<p class="lead">Add to your task list below.</p>
<hr>
{!! Form::open(['route' => 'tasks.store']) !!}

<div class="form-group">
{!! Form::label('title', 'Title:', ['class' => 'control-label']) !!}
{!! Form::text('title', null, ['class' => 'form-control']) !!}
</div>

<div class="form-group">
{!! Form::label('description', 'Description:', ['class' => 'control-label']) !!}
{!! Form::textarea('description', null, ['class' => 'form-control']) !!}
</div>

{!! Form::submit('Create New Task', ['class' => 'btn btn-primary']) !!}

{!! Form::close() !!}
@stop

A task controller I created for the controller sections

Controller->TasksController 

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;

class TasksController extends Controller {

public function index() {
    return view('tasks.index');
}
public function create() {
    return view('tasks.create');
}

}

inside our config/app.php We add one service provider

'Illuminate\Html\HtmlServiceProvider',

aliases something like this

'Form'      => 'Illuminate\Html\FormFacade',
'Html'      => 'Illuminate\Html\HtmlFacade',

In a Vender->laravel->framework->src->Illuminate->Html->HtmlServiceProvider.php

Change the method name to bindingshare to the singleton.

IN The Route file Following code written.

Route::resource('tasks', 'TasksController');

Following Snapshot error display.

Laravel error

查看全部
doumeng06063991
doumeng06063991
2015/12/26 06:33
  • laravel
  • php
  • namespaces
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

1个回复