mardi 1 août 2017

unable to print table data in laravel

need print column data in my laravel app. My controller is TaskController.php

public function index()
{
    $tasks = Task::all();
    return view('tasks.index')->with('tasks', $tasks);
    }

index.blade.php file is

@if(isset($tasks)) 
@foreach ($tasks as $task)
<h1></h1>
@endforeach
@endif

I am going include this index view file in show.blade.php file as following

@include('tasks.index')

but unable to print table data no any errors occurred. how can I print task_name in show view file?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire