vendredi 25 décembre 2015

when i try to creat a crud in laravel i was creat a form but display only Whoops, looks like something went wrong

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.

error page image



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire