2017-02-16 17 views
0

Я хочу отредактировать в Modal, но данные не доходят до opgaveRet.blade.php, содержащего Modal :-(Вот мой код: Может ли кто-нибудь помочь мне увидеть, что я делаю неправильно?Передача данных с контроллера laravel на Modal

// route.php

Route::resource('/admin/opgave', 'Admin\OpgaveController'); 

// OpgaveController.php

public function edit($id) 
    { 

    $tasks = Tasks::findOrFail($id); 

     return view('admin.opgaver.opgaveRet', ['tasks' => $tasks ]); 
    // also tried :-(: 
    //return view('admin.opgave', compact('tasks')); 
    } 

// opgave.blade.php

@foreach ($opgaver as $opgave) 
// here is a table, and then comes the Action 
    <a href="{{ route('opgave.edit', $opgave->id) }}" 
      data-toggle="modal" 
      data-target="#RetOpgave" 
      class="btn btn-primary btn-xs">Edit</a> 
    @endforeach 

// в нижней части opgave.blade.php // @include ('') admin.opgaver.opgaveRet

<div class="modal fade" id="RetOpgave" tabindex="-1" role="dialog" aria-labelledby="RetOpgave"> 
     <div class="modal-dialog" role="document"> 
      <div class="modal-content"> 
      <div class="modal-header"> 
       <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button> 
       <h4 class="modal-title" id="RetOpgave">Ret opgave</h4> 
      </div> 
      <div class="modal-body" > 

       @if(!empty($tasks)) 

    // Here i want to build a FORM:: 
    // But there is nothing in $tasks ??????? 


       {{ dd($tasks) }} 
       @endif 

      </div> 
      <div class="modal-footer"> 
       <button type="button" class="btn btn-default" data-dismiss="modal">Luk</button> 

      </div> 
      </div> 
     </div> 
     </div> 

ответ

 Смежные вопросы

  • Нет связанных вопросов^_^