I need to send a data through the render()
method, however I do not know how to receive it in the view. Here is my code ( print_r($datos)
generates me error: Undefined variable: datos
):
Driver: InventoryDetailReportController.php
class InventoryDetailReportController extends Controller { public function index (InventoryDetailDataTable $dataTable, Request $request, $inventario='') { $datos = array(); array_push($datos, $inventario); return $dataTable->with('inventario', $inventario)->render('vista-reporte-inventario', $datos); } }
View: vista-report-inventory.blade.php
@extends('layouts.master') @section('content') {!! $dataTable->table() !!} {!! print_r($datos) !!} @endsection @push('scripts') /** Aquí van los scripts de datatables */ {!! $dataTable->scripts() !!} @endpush
I tried to access the data with $dataTable->datos
but it did not work for me. I appreciate any help.