Skip to content

Instantly share code, notes, and snippets.

@cyberfly
Created April 28, 2017 14:14
Show Gist options
  • Save cyberfly/6ebbcc0b649b73f110262d381f39eece to your computer and use it in GitHub Desktop.
Save cyberfly/6ebbcc0b649b73f110262d381f39eece to your computer and use it in GitHub Desktop.
Laravel Collective Real World Example, with Class, ID, File Upload, and Custom Method
{!! Form::open(['route' => 'tickets.store','class' => 'form-horizontal', 'files' => true]) !!}
{!! Form::label('state_id', 'State') !!}
{!! Form::text('product_name','',['class'=>'form-control']); !!}
{!! Form::radio('condition', 'new', true); !!} New
{!! Form::radio('condition', 'used', false); !!} Used
{!! Form::select('state_id', $states, null, ['placeholder' => 'Select State','class'=>'form-control','id'=>'state_id']); !!}
{!! Form::close() !!}
{!! Form::open(['route' => ['tickets.update',$ticket->id],'class' => 'form-horizontal', 'method'=>'PUT', 'files' => true]) !!}
{!! Form::text('ticket_subject',$ticket->ticket_subject,['class'=>'form-control']) !!}
{!! Form::select('category_id',$categories,$ticket->category_id,['class'=>'form-control']) !!}
{!! Form::close() !!}
@foreach($tickets as $ticket)
<tr>
<td>
<a href="{!! route('tickets.show',$ticket->id) !!}" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-zoom-in" aria-hidden="true"></span></a>
<a href="{!! route('tickets.edit',$ticket->id) !!}" class="btn btn-default btn-xs"><span class="glyphicon glyphicon-pencil" aria-hidden="true"></span></a>
</td>
</tr>
@endforeach
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment