cyberfly
4/28/2017 - 2:14 PM

Laravel Collective Real World Example, with Class, ID, File Upload, and Custom Method

Laravel Collective Real World Example, with Class, ID, File Upload, and Custom Method

@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
{!! 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() !!}
{!! 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() !!}