Category: Laravel

  • Understanding View::share in Laravel

    Understanding View::share in Laravel is easy but tricky to new users. Here I will try to clear the confusions of Laravel’s View::share. First look at the code below. We defined a ProfileController and inside it we have a public function as getIndex(). <?php class ProfileController extends BaseController{ public function getIndex(){ $profile_info = User::find(‘2’); View::share(‘getinfo’,$profile_info); $this->layout->content […]