I am learning laravel following a tutorial. I am stuck with this error
Method open does not exist. (View: path\to\project\resources\views\form.blade.php)
I am using FormFacade. earlier I was facing an error saying: Call to undefined method Illuminate\Foundation\Application::bindShared()
which I overcame by replacing bindShared with singleton all over the file
/path/project/vendor/illuminate/html/HtmlServiceProvider.php
form.blade.php
<html>
<head>
<link rel="stylesheet" type="text/css" href="http://ift.tt/1jAc5cP">
</head>
<body>
<h1>Create a new form</h1>
<hr/>
{{ Form::open() }}
{{ Form::close() }}
</body>
</html>
HtmlServiceProvider.php
use Illuminate\Support\ServiceProvider;
class HtmlServiceProvider extends ServiceProvider {
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = true;
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
$this->registerHtmlBuilder();
$this->registerFormBuilder();
$this->app->alias('html', 'Illuminate\Html\HtmlBuilder');
$this->app->alias('form', 'Illuminate\Html\FormBuilder');
}
/**
* Register the HTML builder instance.
*
* @return void
*/
protected function registerHtmlBuilder()
{
$this->app->singleton('html', function($app)
{
return new HtmlBuilder($app['url']);
});
}
/**
* Register the form builder instance.
*
* @return void
*/
protected function registerFormBuilder()
{
$this->app->singleton('form', function($app)
{
$form = new FormBuilder($app['html'], $app['url'], $app['session.store']->getToken());
return $form->setSessionStore($app['session.store']);
});
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return array('html', 'form');
}
}
Plese Help.
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1K00SPw
via IFTTT
Aucun commentaire:
Enregistrer un commentaire