Merge pull request #6 from 4xmen/master

pull/8/head
Amirabbas Momeni 2 years ago committed by GitHub
commit 0e56e3915a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -34,7 +34,7 @@ class Acl
return abort(403, __("You dont't have acccess this acction"));
}
// check delete or destroy with bulk action
if ($requestPath[2] == 'bulk' && $request->input('bulk') == 'delete') {
if (isset($requestPath[2]) && $requestPath[2] == 'bulk' && $request->input('bulk') == 'delete') {
$requestPath[2] = 'delete';
if (!auth()->user()->hasAccess(implode('.', $requestPath))) {
$requestPath[2] = 'destroy';

@ -101,7 +101,10 @@ class User extends Authenticatable
return $this->hasMany(Access::class);
}
public function hasAnyAccess($name){
return $this->accesses()->where('route','LIKE','%'.$name.'%')->count() > 0;
if ($this->hasRole('super-admin')){
return true;
}
return $this->accesses()->where('route','LIKE','%.'.$name.'.%')->count() > 0;
}
public function hasAccess($route){

@ -19,7 +19,7 @@ class ProductFactory extends Factory
{
$rand = rand(1,2);
$title = ($rand == 1?'موبایل':'تبلت').' ' . $this->faker->unique()->realText(50);
$title = ($rand == 1?'موبایل':'تبلت').' ' . $this->faker->unique()->firstNameFemale;
return [
//
'name' => $title,

@ -21,26 +21,26 @@
"sass-loader": "^11.0.1",
"vue": "^2.6.12",
"vue-loader": "^15.9.8",
"vue-template-compiler": "^2.7.10"
"vue-template-compiler": "^2.7.10",
"lightbox2": "^2.11.3",
"owl.carousel": "^2.3.4",
"persian-date": "^1.1.0",
"persian-datepicker": "^1.2.0",
"alertifyjs": "^1.13.1",
"chart.js": "^3.8.2",
"x-mega-menu": "^1.2.0",
"xzoom": "^1.0.15"
},
"dependencies": {
"@fortawesome/fontawesome-free": "^6.1.1",
"alertifyjs": "^1.13.1",
"chart.js": "^3.8.2",
"hc-offcanvas-nav": "^6.1.5",
"jquery": "^2.2.4",
"jquery-sortable": "^0.9.13",
"lightbox2": "^2.11.3",
"owl.carousel": "^2.3.4",
"persian-date": "^1.1.0",
"persian-datepicker": "^1.2.0",
"rvnm": "^1.4.0",
"select2": "^4.1.0-rc.0",
"vazir-font": "^30.1.0",
"vue-multiselect": "^2.1.6",
"vue-select2": "^0.2.6",
"vue-simple-range-slider": "^1.0.0",
"x-mega-menu": "^1.2.0",
"xzoom": "^1.0.15"
"vue-simple-range-slider": "^1.0.0"
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1,4 +1,4 @@
@extends('website.layout')
@extends('website.layout.layout')
@section('content')
<div id="main-conetent">
<section id="product" class="wow zoomInUp" data-wow-delay=".5">

@ -13,6 +13,7 @@
{{__("Catalog")}}
</a>
<ul>
@if(auth()->user()->hasAnyAccess('product'))
<li id="product-li">
<a>
<i class="fa fa-gem"></i>
@ -31,6 +32,8 @@
</li>
</ul>
</li>
@endif
@if(auth()->user()->hasAnyAccess('invoice'))
<li id="invoices-li">
<a>
<i class="fa fa-file-invoice"></i>
@ -49,6 +52,8 @@
</li>
</ul>
</li>
@endif
@if(auth()->user()->hasAnyAccess('customer'))
<li>
<a>
<i class="fa fa-users"></i>
@ -67,6 +72,8 @@
</li>
</ul>
</li>
@endif
@if(auth()->user()->hasAnyAccess('discount'))
<li id="discount-li">
<a>
<i class="fa fa-percent"></i>
@ -85,18 +92,24 @@
</li>
</ul>
</li>
@endif
@if(auth()->user()->hasAnyAccess('question'))
<li id="questions-li">
<a href="{{route('admin.question.index')}}">
<i class="fa fa-question"></i>
{{__('Questions')}}
</a>
</li>
@endif
@if(auth()->user()->hasAnyAccess('ticket'))
<li id="tickets-li">
<a href="{{route('admin.ticket.index')}}">
<i class="fa fa-envelope"></i>
{{__('Tickets')}}
</a>
</li>
@endif
@if(auth()->user()->hasAnyAccess('cat'))
<li>
<a>
<i class="fa fa-cubes"></i>
@ -120,6 +133,9 @@
</li>
</ul>
</li>
@endif
@if(auth()->user()->hasAnyAccess('transport'))
<li>
<a>
<i class="fa fa-truck"></i>
@ -138,8 +154,10 @@
</li>
</ul>
</li>
@endif
@if(auth()->user()->hasAnyAccess('props'))
<li>
<a >
<a>
<i class="fa fa-project-diagram"></i>
{{__("Properties meta")}}
</a>
@ -157,12 +175,11 @@
</ul>
</li>
@endif
</ul>
</li>
<li id="cms" class="main-nav">
<a>
<i class="fab fa-internet-explorer"></i>
@ -170,6 +187,7 @@
{{__("Website contents")}}
</a>
<ul>
@if(auth()->user()->hasAnyAccess('post'))
<li id="posts-li">
<a>
<i class="fa fa-bullhorn"></i>
@ -188,6 +206,8 @@
</li>
</ul>
</li>
@endif
@if(auth()->user()->hasAnyAccess('category'))
<li>
<a>
<i class="fa fa-book"></i>
@ -213,11 +233,12 @@
</li>
@endif
@if(auth()->user()->hasAnyAccess('gallery'))
<li>
<a >
<a>
<i class="fa fa-images"></i>
{{__("Galleries")}}
</a>
@ -237,8 +258,10 @@
</ul>
</li>
@endif
@if(auth()->user()->hasAnyAccess('clip'))
<li>
<a >
<a>
<i class="fa fa-file-video"></i>
{{__("Video clips")}}
</a>
@ -256,8 +279,10 @@
</ul>
</li>
@endif
@if(auth()->user()->hasAnyAccess('adv'))
<li>
<a >
<a>
<i class="fa fa-atom"></i>
{{__("Advertise")}}
</a>
@ -275,14 +300,18 @@
</ul>
</li>
@endif
@if(auth()->user()->hasAnyAccess('menu'))
<li>
<a href="{{route('admin.menu.index')}}" >
<a href="{{route('admin.menu.index')}}">
<i class="fa fa-list-alt"></i>
{{__("Menus")}}
</a>
</li>
@endif
@if(auth()->user()->hasAnyAccess('props'))
<li>
<a >
<a>
<i class="fa fa-file-image"></i>
{{__("Slider")}}
</a>
@ -300,8 +329,10 @@
</ul>
</li>
@endif
@if(auth()->user()->hasAnyAccess('poll'))
<li>
<a >
<a>
<i class="fa fa-vote-yea"></i>
{{__("Poll")}}
</a>
@ -319,42 +350,53 @@
</ul>
</li>
@endif
</ul>
</li>
@if(auth()->user()->hasAnyAccess('comment'))
<li>
<a href="{{route('admin.comment.index')}}">
<i class="fa fa-comments"></i>
{{__('Comments')}}
</a>
</li>
@endif
@if(auth()->user()->hasAnyAccess('setting'))
<li>
<a href="{{route('admin.setting.index')}}">
<i class="fa fa-cogs"></i>
{{__("Setting")}}
</a>
</li>
@endif
@if(auth()->user()->hasAnyAccess('attachment'))
<li>
<a href="{{route('admin.attachment.index')}}">
<i class="fa fa-paperclip"></i>
{{__("Attachments")}}
</a>
</li>
@endif
@if(auth()->user()->hasAnyAccess('contact'))
<li>
<a href="{{route('admin.contact.index')}}">
<i class="fa fa-envelope"></i>
{{__("Contact us")}}
</a>
</li>
@endif
@if(auth()->user()->hasAnyAccess('logs'))
<li>
<a href="{{route('admin.logs.index')}}">
<i class="fa fa-list-alt"></i>
{{__('Logs')}}
</a>
</li>
@endif
@if(auth()->user()->hasRole('super-admin'))
<li>
<a >
<a>
<i class="fa fa-users"></i>
{{__("Users")}}
</a>
@ -374,13 +416,14 @@
</ul>
</li>
@endif
@guest
<li >
<li>
<a href="{{ route('login') }}"> <i class="fa fas fa-sign-in"></i> {{ __('Login') }}</a>
</li>
@if (Route::has('register'))
<li >
<li>
<a href="{{ route('register') }}"> <i class="fa fas fa-sign-in"></i> {{ __('Register') }}</a>
</li>
@endif

@ -1,4 +1,4 @@
@extends('website.layout')
@extends('website.layout.layout')
@section('title')
{{__("Shopping card")}} -
@endsection

@ -1,4 +1,4 @@
@extends('website.layout')
@extends('website.layout.layout')
@section('title')
{{$cat->name}} -
@endsection
@ -42,7 +42,7 @@
@endif
>
@include('website.sidebar')
@include('website.layout.sidebar')
</meta-search>
</aside>
</div>
@ -50,7 +50,7 @@
<div class="list-grid">
@foreach($products as $pro)
<div class="item">
@include('website.component.pro',['p' => $pro])
@include('website.component.product-box',['p' => $pro])
</div>
@endforeach
</div>

@ -1,4 +1,4 @@
@extends('website.layout')
@extends('website.layout.layout')
@section('title')
{{__("Compare products")}} -
@endsection

@ -0,0 +1,94 @@
<footer>
<div class="container">
<div class="row">
<div class="col-md-3">
<h3>
{{\App\Helpers\getSettingCategory('footer1')->name}}
</h3>
<ul>
@foreach(\App\Helpers\getSettingCategory('footer1')->posts as $p)
<li>
<a href="{{route('n.show',$p->slug)}}">
{{$p->title}}
</a>
</li>
@endforeach
</ul>
</div>
<div class="col-md-3">
<h3>
{{\App\Helpers\getSettingCategory('footer2')->name}}
</h3>
<ul>
@foreach(\App\Helpers\getSettingCategory('footer2')->posts as $p)
<li>
<a href="{{route('n.show',$p->slug)}}">
{{$p->title}}
</a>
</li>
@endforeach
</ul>
</div>
<div class="col-md-3">
<h3>
اطلاعات تماس
</h3>
<p class="text-secondary">
افراد گروه سوم از اهمیت به پایان رساندن آگاه هستند. آنها با تفکر منطقی، طرحی روشن ارائه می‌کنند. آنها نه تنها برای پایان دادن به پروژه‌ی خود در آینده برنامه ریزی می‌کنند، بلکه به تمام نتایج و عواقب اجرای آن برنامه هم می‌اندیشند. این افراد کسانی هستند که هنر به پایان رساندن را می‌دانند.
</p>
</div>
<div class="col-md-3">
<h3>
نمادها
</h3>
<div class="text-center namad">
{!! \App\Helpers\getSetting('footer3') !!}
</div>
</div>
<div class="col-md-12 pb-4">
<hr>
<div class="p4 text-center social">
@if(trim(\App\Helpers\getSetting('soc_in')) != '')
<a target="_blank" href="{{\App\Helpers\getSetting('soc_in')}}">
<i class="fab fa-instagram"></i>
</a>
@endif
@if(trim(\App\Helpers\getSetting('soc_tg')) != '')
<a target="_blank" href="{{\App\Helpers\getSetting('soc_tg')}}">
<i class="fab fa-telegram"></i>
</a>
@endif
@if(trim(\App\Helpers\getSetting('soc_wp')) != '')
<a target="_blank"
href="https://api.whatsapp.com/send/?phone={{urlencode(\App\Helpers\getSetting('soc_wp'))}}&text=%D8%A8%D8%A7%20%D8%B3%D9%84%D8%A7%D9%85%0A%D8%A7%D8%B2%20%D8%B3%D8%A7%DB%8C%D8%AA%20%D8%A8%D8%B1%D8%A7%DB%8C%20%D8%B3%D9%81%D8%A7%D8%B1%D8%B4%20%D9%88%20%D9%BE%D8%B4%D8%AA%DB%8C%D8%A8%D8%A7%D9%86%DB%8C%20%D8%AA%D9%85%D8%A7%D8%B3%20%D9%85%DB%8C%DA%AF%DB%8C%D8%B1%D9%85&app_absent=0">
<i class="fab fa-whatsapp"></i>
</a>
@endif
@if(trim(\App\Helpers\getSetting('soc_tw')) != '')
<a target="_blank" href="{{\App\Helpers\getSetting('soc_tw')}}">
<i class="fab fa-twitter"></i>
</a>
@endif
@if(trim(\App\Helpers\getSetting('soc_yt')) != '')
<a target="_blank" href="{{\App\Helpers\getSetting('soc_yt')}}">
<i class="fab fa-youtube"></i>
</a>
@endif
</div>
<hr>
<div class="text-center text-black-50">
{{\App\Helpers\getSetting('copyright')}}
&copy; {{date('Y')}}
</div>
</div>
</div>
</div>
</footer>
<input type="hidden" id="fav-toggle" value="{{route('fav.toggle','')}}">
@yield('js-content')
<script src="{{asset('js/theme.js')}}" defer></script>
@include('component.lang')
</body>
</html>

@ -1,5 +1,5 @@
<!doctype html>
<html lang="en">
<html lang="{{config('app.locale')}}">
<head>
<meta charset="UTF-8">
<meta name="viewport"
@ -141,113 +141,3 @@
</section>
@include('website.component.navbar')
<div id="main-container" class="@yield('body-class')">
<div id="app">
@yield('content')
</div>
</div>
{{--<a id="card-info" @if(\App\Helpers\cardCount() == 0) style="display: none" @endif href="{{route('card.show')}}">--}}
{{-- <button type="button" class="btn btn-primary position-relative">--}}
{{-- <img src="{{asset('images/basket.svg')}}" class="basket-icon" alt="add to card">--}}
{{-- <span class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger">--}}
{{-- <b id="card-count">--}}
{{-- {{\App\Helpers\cardCount()}}--}}
{{-- </b>--}}
{{-- </span>--}}
{{-- </button>--}}
{{--</a>--}}
<footer>
<div class="container">
<div class="row">
<div class="col-md-3">
<h3>
{{\App\Helpers\getSettingCategory('footer1')->name}}
</h3>
<ul>
@foreach(\App\Helpers\getSettingCategory('footer1')->posts as $p)
<li>
<a href="{{route('n.show',$p->slug)}}">
{{$p->title}}
</a>
</li>
@endforeach
</ul>
</div>
<div class="col-md-3">
<h3>
{{\App\Helpers\getSettingCategory('footer2')->name}}
</h3>
<ul>
@foreach(\App\Helpers\getSettingCategory('footer2')->posts as $p)
<li>
<a href="{{route('n.show',$p->slug)}}">
{{$p->title}}
</a>
</li>
@endforeach
</ul>
</div>
<div class="col-md-3">
<h3>
اطلاعات تماس
</h3>
<p class="text-secondary">
افراد گروه سوم از اهمیت به پایان رساندن آگاه هستند. آنها با تفکر منطقی، طرحی روشن ارائه می‌کنند. آنها نه تنها برای پایان دادن به پروژه‌ی خود در آینده برنامه ریزی می‌کنند، بلکه به تمام نتایج و عواقب اجرای آن برنامه هم می‌اندیشند. این افراد کسانی هستند که هنر به پایان رساندن را می‌دانند.
</p>
</div>
<div class="col-md-3">
<h3>
نمادها
</h3>
<div class="text-center namad">
{!! \App\Helpers\getSetting('footer3') !!}
</div>
</div>
<div class="col-md-12 pb-4">
<hr>
<div class="p4 text-center social">
@if(trim(\App\Helpers\getSetting('soc_in')) != '')
<a target="_blank" href="{{\App\Helpers\getSetting('soc_in')}}">
<i class="fab fa-instagram"></i>
</a>
@endif
@if(trim(\App\Helpers\getSetting('soc_tg')) != '')
<a target="_blank" href="{{\App\Helpers\getSetting('soc_tg')}}">
<i class="fab fa-telegram"></i>
</a>
@endif
@if(trim(\App\Helpers\getSetting('soc_wp')) != '')
<a target="_blank"
href="https://api.whatsapp.com/send/?phone={{urlencode(\App\Helpers\getSetting('soc_wp'))}}&text=%D8%A8%D8%A7%20%D8%B3%D9%84%D8%A7%D9%85%0A%D8%A7%D8%B2%20%D8%B3%D8%A7%DB%8C%D8%AA%20%D8%A8%D8%B1%D8%A7%DB%8C%20%D8%B3%D9%81%D8%A7%D8%B1%D8%B4%20%D9%88%20%D9%BE%D8%B4%D8%AA%DB%8C%D8%A8%D8%A7%D9%86%DB%8C%20%D8%AA%D9%85%D8%A7%D8%B3%20%D9%85%DB%8C%DA%AF%DB%8C%D8%B1%D9%85&app_absent=0">
<i class="fab fa-whatsapp"></i>
</a>
@endif
@if(trim(\App\Helpers\getSetting('soc_tw')) != '')
<a target="_blank" href="{{\App\Helpers\getSetting('soc_tw')}}">
<i class="fab fa-twitter"></i>
</a>
@endif
@if(trim(\App\Helpers\getSetting('soc_yt')) != '')
<a target="_blank" href="{{\App\Helpers\getSetting('soc_yt')}}">
<i class="fab fa-youtube"></i>
</a>
@endif
</div>
<hr>
<div class="text-center text-black-50">
{{\App\Helpers\getSetting('copyright')}}
&copy; {{date('Y')}}
</div>
</div>
</div>
</div>
</footer>
<input type="hidden" id="fav-toggle" value="{{route('fav.toggle','')}}">
@yield('js-content')
<script src="{{asset('js/theme.js')}}" defer></script>
@include('component.lang')
</body>
</html>

@ -1,4 +1,4 @@
@extends('website.layout')
@extends('website.layout.layout')
@section('title')
{{$title}}
@endsection

@ -1,4 +1,4 @@
@extends('website.layout')
@extends('website.layout.layout')
@section('title')
{{__("Customer profile")}} -
@endsection
@ -534,7 +534,7 @@
@else
@foreach(auth('customer')->user()->products as $p)
<div class="col-md-3">
@include('website.component.pro',['p' => $p])
@include('website.component.product-box',['p' => $p])
</div>
@endforeach
@endif

@ -1,4 +1,4 @@
@extends('website.layout')
@extends('website.layout.layout')
@section('content')
<section id="index-top">
<div class="container">

@ -1,4 +1,4 @@
@extends('website.layout')
@extends('website.layout.layout')
@section('title')
{{__("Invoice")}} - {{$invoice->id}}
@endsection

@ -0,0 +1,9 @@
@include('website.component.header')
<div id="main-container" class="@yield('body-class')">
<div id="app">
@yield('content')
</div>
</div>
@include('website.component.footer')

@ -1,4 +1,4 @@
@extends('website.layout')
@extends('website.layout.layout')
@section('title')
{{$post->title}} -
@endsection

@ -1,4 +1,4 @@
@extends('website.layout')
@extends('website.layout.layout')
@section('title')
{{$title}} -
@endsection

@ -1,4 +1,4 @@
@extends('website.layout')
@extends('website.layout.layout')
@section('title')
{{$pro->name}} -
@endsection
@ -368,7 +368,7 @@
<div class="owl-carousel owl-sq">
@foreach ($cat->products()->where('stock_quantity','>', 0)->limit(10)->get() as $p)
<div class="item ">
@include('website.component.pro',['p' => $p])
@include('website.component.product-box',['p' => $p])
</div>
@endforeach
</div>

@ -1,4 +1,4 @@
@extends('website.layout')
@extends('website.layout.layout')
@section('title')
{{__("Products")}} -
@endsection
@ -22,13 +22,13 @@
</div>
</div>
<div class="col-xl-3 col-md-4">
@include('website.sidebar')
@include('website.layout.sidebar')
</div>
<div class="col-xl-9 col-md-8">
<div class="list-grid">
@foreach($products as $pro)
<div class="item">
@include('website.component.pro',['p' => $pro])
@include('website.component.product-box',['p' => $pro])
</div>
@endforeach
</div>

@ -1,4 +1,4 @@
@extends('website.layout')
@extends('website.layout.layout')
@section('title')
{{__("Signup or Login")}} -
@endsection

@ -1,4 +1,4 @@
@extends('website.layout')
@extends('website.layout.layout')
@section('title')
{{__("Signup or Login")}} -
@endsection

@ -1,4 +1,4 @@
@extends('website.layout')
@extends('website.layout.layout')
@section('title')
{{__("Customer profile")}} -
@endsection

@ -1,4 +1,4 @@
@extends('website.layout')
@extends('website.layout.layout')
@section('title')
کدهای رهگیری -
@endsection

Loading…
Cancel
Save