Can I put the View::composer code inside a method of a controller?, i'm trying but the code inside is not running:
/** * Controller method */ public function patientDetail($code){ // Obtain the patient $thepatient = Patient::where('document', '=', $code)->first(); View::composer('test.alltests', function($view){ Log::info("In the patient composser"); $view->with('patient', $thepatient); }); return View::make('patient.detail', compact('thepatient')); }
Thanks.
Can I put the View::composer code inside a method of a controller?, i'm trying but the code inside is not running:
Thanks.