jcadima
8/20/2017 - 5:14 PM

Laravel Include Error

Laravel Include Error

1) Create:  views/includes/errors.blade.php
and put:

@if ( count($errors) > 0 )
	<ul class="list-group">
		@foreach ( $errors->all() as $error )
			<li class="list-group-item text-danger">
				{{ $error }}
			</li>
		@endforeach
	</ul>

@endif



2) Now include it in your blade template, for example: create.blade.php

@extends('layout')

@section('content')

@include('includes.errors') 

<form action="{{ route('project.store') }}" method="POST">
    {{ csrf_field() }}

    <div class="col-md-8">
    	<label>Create a new Project <span class="glyphicon glyphicon-folder-open" aria-hidden="true"></span></label>
		<div class="form-group">
			<input type="text" class="form-control" name="project">
		</div>
	</div>



    <div class="col-md-12"><input type="submit" value="Submit"></div>

</form>

@stop