I'm new at laravel , and trying to make the variable of content at the header shared with all views , but the issue is with getting the language which backing with me with null value at the provider ( AppServiceProvider ) class :
and here's my code :
public function boot( )
{
// $language=App::setLocale($locale);
$locale = App::getLocale();
\Session::put('language', 'en');
\Config::get('app.locale');
\Config::get('languages') ;
\Session::get('languages', 'en');
$lang = Session::get ('locale');
$products = ProductsTranslation::join('products', 'products.id', '=', 'products_translations.product_id')->where('language',$lang) ->get();
$postId = Post::get();
view()->share('products', $products,'language',' \Session::get("language", $locale )','postId',$postId);
}
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2koHPav
via IFTTT
Aucun commentaire:
Enregistrer un commentaire