Answers for "how to pass data to all views in laravel"

PHP
1

return view with variable laravel

return View::make('blog')->with('posts', $posts);
Posted by: Guest on February-09-2021
1

return view with variable laravel

return View::make('blog')->with('posts', $posts);
Posted by: Guest on February-09-2021
0

laravel data share all views

<?php

namespace App\Providers;

use Illuminate\Support\Facades\View;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        View::share('key', 'value');
    }
}
Posted by: Guest on December-22-2020
0

laravel data share all views

<?php

namespace App\Providers;

use Illuminate\Support\Facades\View;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        //
    }

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        View::share('key', 'value');
    }
}
Posted by: Guest on December-22-2020

Code answers related to "how to pass data to all views in laravel"

Browse Popular Code Answers by Language