Table of Contents
php artisan list
php artisan serve
php artisan make:model Post -m
php artisan make:migration create_posts_table
php artisan migrate
php artisan make:controller PostsController --resource
php artisan down
route('posts.index')
route('posts.edit', $post->id)
Route::resource('posts','PostController');
Route::get('contact', 'PagesController@getContact');
return view('pages.index');return
return view('posts.index')->withPosts($posts);
Visit this link For more info
{!! Form::open(['route' => 'posts.store', 'data-parsley-validate' => '']) !!}
{{ Form::label('title', 'Title:') }}
{{ Form::text('title', null, array('class' => 'form-control', 'required' => '', 'maxlength' => '255')) }}
{{ Form::label('body', 'Post Body:') }}
{{ Form::textarea('body', null, array('class' => 'form-control', 'required' => '')) }}
{{ Form::submit('Create Post', array('class' => 'btn btn-success btn-lg btn-block', 'style' => 'margin-top: 20px;'))}}
{!! Form::close() !!}
Form Model Binding
{!! Form::model($post, ['route' => ['posts.update', $post->id], 'method' => 'PUT', 'data-parsley-validate' => '']) !!}
Add css & Js
{!! Html::style('css/parsley.css') !!}
{!! Html::script('js/parsley.min.js') !!}
class="{{ Request::is('/') ? 'active' : '' }}"
$request->title;
// Validate form data
$this->validate($request, array(
'title' => 'required|max:255',
'body' => 'required'
));
'''