Skip to content

Commit

Permalink
Update to Laravel 5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
raylight75 committed Mar 3, 2017
1 parent 8e3789c commit 75a8f77
Show file tree
Hide file tree
Showing 20 changed files with 495 additions and 340 deletions.
589 changes: 313 additions & 276 deletions .idea/workspace.xml

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions app/Http/Controllers/BaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use App\Services\BaseService;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\App;
use View;

class BaseController extends Controller
Expand Down Expand Up @@ -156,6 +157,18 @@ public function set_currency(Request $request,$currency = "")
return redirect()->back();
}

/**
* Set language to session
* @param string $locale
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function set_language(Request $request,$locale = "")
{
$locale = ($locale != "") ? $locale : "en";
$request->session()->put('locale', $locale);
return redirect()->back();
}

/**
* Show login page to user
* @return View
Expand Down
1 change: 1 addition & 0 deletions app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class Kernel extends HttpKernel
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\App\Http\Middleware\LanguageMiddleware::class,
],

'api' => [
Expand Down
37 changes: 37 additions & 0 deletions app/Http/Middleware/LanguageMiddleware.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Http\Request;
use Illuminate\Foundation\Application;

class LanguageMiddleware
{

/**
* LanguageMiddleware constructor.
* @param Application $app
* @param Request $request
*/
public function __construct(Application $app, Request $request)
{
$this->app = $app;
$this->request = $request;
}

/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$locale = $request->session()->get('locale');
$this->app->setLocale($locale);
return $next($request);
}

}
32 changes: 32 additions & 0 deletions resources/lang/bg/site.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,39 @@
'home' => 'Главна Страница',
'checkout' => 'Поръчка',
'blog' => 'Блог',
'sale' => 'Разпродажба',
'contacts' => 'Контакти',
'about us' => 'Информация',
'login' => 'Влез',
'featured' => 'Актуални продукти',
'arrivals' => 'Нови продукти',
'аvailable color' => 'Налични цветове',
'аvailable size' => 'Налични размери',
'discount code' => 'Код за отстъпка',
'color' => 'Цвят',
'size' => 'Размер',
'аdd to bag' => 'Добави в кощницата',
'share' => 'Сподели с приятели',
'products' => 'Продукти',
'product' => 'Продуктов',
'view' => 'изглед',
'quick view' => 'Бърз преглед',
'logout' => 'Изход',
'information' => 'Информация',
'delivery' => 'Доставка',
'privacy' => 'Правила',
'faqs' => 'Въпроси',
'about shop' => 'За магазина',
'newsletter' => 'Новини',
'social' => 'Ние сме в социалните мрежи',
'description' => 'Описание',
'other' => 'Други продукти',
'by color' => 'Сортирай по цвят',
'by size' => 'Сортирай по размер',
'by brands' => 'Сортирай по производител',
'by price' => 'Сортирай по цена',
'by name' => 'Сортирай по име',
'by cats' => 'Категории',
'lng' => 'Език',

];
31 changes: 31 additions & 0 deletions resources/lang/en/site.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,38 @@
'home' => 'home',
'checkout' => 'checkout',
'blog' => 'blog',
'sale' => 'sale',
'contacts' => 'contacts',
'about us' => 'about us',
'login' => 'Login',
'featured' => 'Featured products',
'arrivals' => 'New arrivals',
'аvailable color' => 'Available color',
'аvailable size' => 'Available size',
'discount code' => 'Discount code',
'color' => 'color',
'size' => 'size',
'аdd to bag' => 'Add to bag',
'share' => 'Share item with friends',
'products' => 'Products',
'product' => 'Product',
'view' => 'view',
'quick view' => 'quick view',
'logout' => 'logout',
'information' => 'Information',
'delivery' => 'Delivery',
'privacy' => 'Privacy police',
'faqs' => 'Faqs',
'about shop' => 'About shop',
'newsletter' => 'Newsletter',
'social' => 'we are in social networks',
'description' => 'Description',
'other' => 'other products',
'by color' => 'SORT BY COLOR',
'by size' => 'SORT BY SIZE',
'by brands' => 'SORT BY BRANDS',
'by price' => 'SORT BY PRICE',
'by name' => 'SORT BY NAME',
'by cats' => 'SHOP BY CATEGORIES',
'lng' => 'Language',
];
6 changes: 3 additions & 3 deletions resources/views/frontend/body.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<!-- CONTAINER -->
<div class="container">
<h2><?= _('Featured products')?></h2>
<h2>@lang('site.featured')</h2>

<!-- ROW -->
<div class="row">
Expand Down Expand Up @@ -36,7 +36,7 @@ class="col-lg-3 col-md-3 col-sm-4 col-xs-6 col-ss-12 padbot40">
<div class="tovar_item_btns">
<a class="open-project tovar_view"
href="{{ url('/') }}/{{$row->category->cat}}/{{$row->slug}}/{{$row->product_id}}">
<span><?= _('product')?></span> <?= _('view')?></a>
<span>@lang('site.product')</span> @lang('site.view')</a>
<a class="add_bag" href="{{ url('login') }}"><i class="fa fa-shopping-cart"></i></a>
</div>
</div>
Expand Down Expand Up @@ -98,7 +98,7 @@ class="col-lg-3 col-md-3 col-sm-4 col-xs-6 col-ss-12 padbot40">

<!-- CONTAINER -->
<div class="container">
<h2><?= _('new arrivals')?></h2>
<h2>@lang('site.arrivals')</h2>

<!-- JCAROUSEL -->
<div class="jcarousel-wrapper">
Expand Down
14 changes: 7 additions & 7 deletions resources/views/frontend/clearfix.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
</div>
</div>
<div class="tovar_color_select">
<p><?= _('Available color')?></p>
<p>@lang('site.аvailable color')</p>
@foreach($item->color as $c)
<a class="color{{$c->color_id}}"></a>
@endforeach
</div>
<div class="tovar_size_select">
<div class="clearfix">
<p class="pull-left"><?= _('Available SIZE')?></p>
<p class="pull-left">@lang('site.аvailable size')</p>
</div>
@foreach($item->size as $s)
<a class="sizeXXXL">{{$s->size}}</a>
Expand All @@ -48,17 +48,17 @@
<div class="tovar_color_select">
<input type="text" name="discount" value="" id=""
maxlength="7" size="50" style="width: 24%"/>
<span><?= _('DISCOUNT CODE')?></span>
<span>@lang('site.discount code')</span>
@include('messages.flash_message')
</div>
<select name="color" class="basic">
<option value=""><?= _('COLOR')?></option>
<option value="">@lang('site.color')</option>
@foreach($item->color as $c)
<option value="{{$c->color}}">{{$c->color}}</option>
@endforeach
</select>
<select name="size" class="basic">
<option value=""><?= _('SIZE')?></option>
<option value="">@lang('site.size')</option>
@foreach($item->size as $s)
<option value="{{$s->size}}">{{$s->size}}</option>
@endforeach
Expand All @@ -72,7 +72,7 @@
@include('errors.error_layout')
@if (!Auth::check())
<a class="add_bag" href="{{ url('login') }}">
<i class="fa fa-shopping-cart"></i><?= _('Add to bag')?></a>
<i class="fa fa-shopping-cart"></i>@lang('site.аdd to bag')</a>
@else
{!! Form::hidden('id', $item->product_id) !!}
{!! Form::hidden('name', $item->name) !!}
Expand All @@ -84,7 +84,7 @@
</div>
</div>
<div class="tovar_shared clearfix">
<p><?= _('Share item with friends')?></p>
<p>@lang('site.share')</p>
<ul>
<li><a class="facebook" href="javascript:void(0);"><i class="fa fa-facebook"></i></a></li>
<li><a class="twitter" href="javascript:void(0);"><i class="fa fa-twitter"></i></a></li>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/frontend/filter_view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class="breadcrumb {{$menu[$parent]['name']}} parallax margbot30">
<!-- SORTING TOVAR PANEL -->
<div class="sorting_options clearfix">
<div class="count_tovar_items">
<p><?= _('Products')?></p>
<p>@lang('site.products')</p>
<span>Items</span>
</div>
<!-- //COUNT TOVAR ITEMS -->
Expand Down
28 changes: 12 additions & 16 deletions resources/views/frontend/footer.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="row">

<div class="col-lg-2 col-md-2 col-sm-3 col-xs-6 col-ss-12 padbot30">
<h4><?= _('Contacts')?></h4>
<h4>@lang('site.contacts')</h4>
<div class="foot_address">
<span>Mvc Shop</span>55 Ney York 6515, Grand Tower
</div>
Expand All @@ -20,21 +20,21 @@
</div>

<div class="col-lg-2 col-md-2 col-sm-3 col-xs-6 col-ss-12 padbot30">
<h4><?= _('Information')?></h4>
<h4>@lang('site.information')</h4>
<ul class="foot_menu">
<li><a href="about.html"><?= _('About us')?></a></li>
<li><a href="javascript:void(0);"><?= _('Delivery')?></a></li>
<li><a href="javascript:void(0);"><?= _('Privacy police')?></a></li>
<li><a href="blog.html"><?= _('Blog')?></a></li>
<li><a href="faq.html"><?= _('Faqs')?></a></li>
<li><a href="contacts.html"><?= _('countact us')?></a></li>
<li><a href="about.html">@lang('site.about us')</a></li>
<li><a href="javascript:void(0);">@lang('site.delivery')</a></li>
<li><a href="javascript:void(0);">@lang('site.privacy')</a></li>
<li><a href="blog.html">@lang('site.blog')</a></li>
<li><a href="faq.html">@lang('site.faqs')</a></li>
<li><a href="contacts.html">@lang('site.contacts')</a></li>
</ul>
</div>

<div class="respond_clear_480"></div>

<div class="col-lg-4 col-md-4 col-sm-6 padbot30">
<h4><?= _('About shop')?></h4>
<h4>@lang('site.about shop')</h4>
<p>We ask for your name, telephone number, home address, email
address and age for competitions, prize draws or newsletter sign
ups. When a purchase is made on our site, in addition to the above,
Expand All @@ -47,7 +47,7 @@
<div class="respond_clear_768"></div>

<div class="col-lg-4 col-md-4 padbot30">
<h4><?= _('Newsletter')?></h4>
<h4>@lang('site.newsletter')</h4>
<form class="newsletter_form clearfix" action="javascript:void(0);"
method="get">
<input type="text" name="newsletter"
Expand All @@ -57,7 +57,7 @@
<input class="btn newsletter_btn" type="submit" value="SIGN UP">
</form>

<h4><?= _('we are in social networks')?></h4>
<h4>@lang('site.social')</h4>
<div class="social">
<a href="javascript:void(0);"><i class="fa fa-twitter"></i></a> <a
href="javascript:void(0);"><i class="fa fa-facebook"></i></a> <a
Expand All @@ -78,11 +78,7 @@
<!-- CONTAINER -->
<div class="container clearfix">
<div class="copyright_inf">
<span>Mvc Shop© 2014</span> | <span>Theme modified by Tihomir
Blajev</span> | <a class="back_top" href="javascript:void(0);">
<?= _('Back to Top')?>
<i class="fa fa-angle-up"></i>
</a>
<span>Mvc Shop© 2014</span> | <span>Theme modified by Tihomir Blajev</span>
</div>
</div>
<!-- //CONTAINER -->
Expand Down
8 changes: 4 additions & 4 deletions resources/views/frontend/frame.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</div>

<div class="tovar_view_description">
<div class="tovar_view_title"><h1><?= _('QUICK VIEW')?></h1></div>
<div class="tovar_view_title"><h1>@lang('site.quick view')</h1></div>
<div class="tovar_view_title">{{$item->name}}</div>
<div class="tovar_article">88-305-676</div>
<div class="clearfix tovar_brend_price">
Expand All @@ -38,14 +38,14 @@
</div>
</div>
<div class="tovar_color_select">
<p><?= _('Available color')?></p>
<p>@lang('site.аvailable color')</p>
@foreach($item->color as $c)
<a class="color{{$c->color_id}}"></a>
@endforeach
</div>
<div class="tovar_size_select">
<div class="clearfix">
<p class="pull-left"><?= _('Available SIZE')?></p>
<p class="pull-left">@lang('site.аvailable size')</p>
<span><?= _('Size & Fit')?></span>
</div>
@foreach($item->size as $s)
Expand All @@ -62,7 +62,7 @@
</p>
</div>
<div class="tovar_shared clearfix">
<p><?= _('Share item with friends')?></p>
<p>@lang('site.share')</p>
<ul>
<li><a class="facebook" href="javascript:void(0);"><i class="fa fa-facebook"></i></a></li>
<li><a class="twitter" href="javascript:void(0);"><i class="fa fa-twitter"></i></a></li>
Expand Down
10 changes: 9 additions & 1 deletion resources/views/frontend/header.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<!-- MEGA MENU -->
<li class=" normal menu"><a href="{{ url('blog') }}">@lang('site.blog')</a></li>
<!-- //MEGA MENU -->
<li class="last sale_menu"><a href="{{ url('eshop') }}">@lang('site.blog')</a></li>
<li class="last sale_menu"><a href="{{ url('eshop') }}">@lang('site.sale')</a></li>
<li class="normal menu"><a href="{{ url('contacts') }}">@lang('site.contacts')</a>
<li class="normal menu"><a href="{{ url('aboutus') }}">@lang('site.about us')</a>
<li class="normal menu"><a href="{{ url('login') }}">@lang('site.login')</a>
Expand All @@ -123,6 +123,14 @@
</li>
</ul>
</li>
<li class="sub-menu"><a>@lang('site.lng')</a>
<ul class="mega_menu megamenu_col1 clearfix">
<li class="col">
<ol><li><a href="{{ url('lg') }}/en">en</a></li></ol>
<ol><li><a href="{{ url('lg') }}/bg">bg</a></li></ol>
</li>
</ul>
</li>
</ul>
<!-- //MENU -->
</div>
Expand Down
Loading

0 comments on commit 75a8f77

Please sign in to comment.