Hi @mkellyxp
As @snapey suggested, View Composers would be a great solution in this case.
I don't have a tutorial to suggest here and without more details I can only try to give you a basic step by step guide to adapt to your use case.
You can start by creating the View Composer class. This class will provide the data for the sidebar's dropdown.
As I don't know what information will you be showing there, lets just use options from an Option model as an example:
app\Http\View\Composers\LayoutComposer.php
<?php
namespace App\Http\View\Composers;
use App\Option;
use Illuminate\View\View;
class LayoutComposer
{
public function compose(View $view)
{
$view->with('options', Option::all());
}
}
As you can see, for this example I'm just using the folder View\Composers inside app\Http as suggested on docs.
Then, just to simplify and because it might be the only one you'll use, you could register the view composer within the AppServiceProvider just like this:
app\Providers\AppServiceProvider.php
<?php
namespace App\Providers;
use App\Http\View\Composers\LayoutComposer;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
public function boot(Dispatcher $events)
{
View::composer('layouts.master', LayoutComposer::class);
}
}
Finally, you can access the $options variable (that you've passed from the compose method) inside your layout view as you would do with variables passed from a Controller to render the options at your side bar.
Note that in my example, I have a master.blade.php view inside a layouts folder, so you should change the first argument from 'layouts.master' to point to your layout view.
Hope this helps!