too long

I created a template for the footer and included it in a main template. What is the correct procedure to display the results of a query in the footer so that it is visible on all pages? thanks

If you want to have a variable within a template file, you may want to check out this Laravel page. You can use this to create an application event which will enable you to have a variable that is accessible in your controllers and your views across the site. These app::before functions are placed in your app/filters.php file.

They work like this:

App::before(function($request)
{
    // Singleton (global) object
    App::singleton('someApp', function(){
        $someApp = new stdClass;
        // Do some code here that calculates something and assign it as below
        $someApp->myVaribale = 'Hello World';
        return $someApp;
    });
    $someApp = App::make('someApp');
    View::share('someApp', $someApp);
});

Then in your view/template you can call it by using $someApp->myVariable. In a controller you use it in the same way but before accessing it use $someApp = App::make('someApp');