I am not quite sure I get what you are trying to do, but have you looked at View composers?
Hi, I actually managed to get what I was after by putting my queries in the BaseController.php like this:
class BaseController extends Controller {
public function __construct()
{
$bomserial = Input::get('bomserial');
$bomserials = DB::table('ph_bom_table_head')->select('serial', 'job_desc')->orderBy('serial', 'ASC')->get();
$bomsections = DB::table('ph_bom_table_sections')->select('serial', 'part_num', 'part_desc')->where('serial', '=', $bomserial)->get();
$message = "There are no results ¯\_(ツ)_/¯";
return View::share(compact('bomserials', 'bomsections', 'message', 'dateSql'));
}
Now my queries are available in all views.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community