Skip to content

Instantly share code, notes, and snippets.

@hskrasek
Created October 14, 2014 23:05
Show Gist options
  • Save hskrasek/373982c9143c91a82805 to your computer and use it in GitHub Desktop.
Save hskrasek/373982c9143c91a82805 to your computer and use it in GitHub Desktop.
Laravel 5 Validation
@extends('layout')
@section('content')
<h1>Create a new task...</h1>
<ul>
@foreach($errors->all() as $error)
<li>{{$error}}</li>
@endforeach
</ul>
{!! Form::open(["route" => 'tasks.store']) !!}
<div class="form-group">
{!! Form::label('task', 'Task:') !!}
{!! Form::textarea('task', null, ['class' => 'form-control']) !!}
</div>
<div class="form-group">
{!! Form::submit('Create Task', ['class' => 'btn btn-primary form-control']) !!}
</div>
{!! Form::close() !!}
@stop
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Task Creator</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
@yield('content')
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment