From 9388bf4eaad9b4b8ec9cf3fcfab94fb4375f3804 Mon Sep 17 00:00:00 2001 From: farid saravi Date: Fri, 6 Sep 2019 19:45:10 +0430 Subject: [PATCH 1/3] some cleanup --- app/Address.php | 26 -- app/Attribute.php | 34 --- app/AttributeValue.php | 18 -- app/Auction.php | 23 -- app/BatchShoppingCart.php | 27 -- app/Blog.php | 74 ----- app/BlogCategory.php | 30 -- app/Brand.php | 29 -- app/Business.php | 279 ------------------ app/BusinessItem.php | 186 ------------ app/BusinessItemVariation.php | 51 ---- app/BusinessTitle.php | 38 --- app/Category.php | 122 -------- app/CategoryTempBusiness.php | 12 - app/ChatMessage.php | 10 - app/City.php | 68 ----- app/Client.php | 38 --- app/Comment.php | 25 -- app/ContactMessage.php | 25 -- app/Conversation.php | 30 -- app/Cooperation.php | 38 --- app/CooperationData.php | 34 --- app/CrmEvent.php | 41 --- app/Data.php | 21 -- app/District.php | 30 -- app/EmplQuestion.php | 21 -- app/EmplResults.php | 29 -- app/Event.php | 45 --- app/Faq.php | 25 -- app/FaqCategory.php | 15 - app/Feedback.php | 27 -- app/Finance.php | 15 - app/Gallery.php | 99 ------- app/GalleryLast.php | 90 ------ app/GalleryNew.php | 90 ------ app/Gift.php | 14 - app/Help.php | 24 -- app/HelpCategory.php | 16 - app/Language.php | 13 - app/Like.php | 18 -- app/Message.php | 40 --- app/News.php | 90 ------ app/Offer.php | 19 -- app/Option.php | 24 -- app/Order.php | 66 ----- app/OrderItem.php | 51 ---- app/Payment.php | 13 - app/Permission.php | 14 - app/Portfolio.php | 62 ---- app/Post.php | 32 -- app/Product.php | 98 ------ app/ProductDetail.php | 16 - app/Project.php | 98 ------ app/Promotion.php | 15 - app/Reservation.php | 22 -- app/Role.php | 18 -- app/RollCall.php | 18 -- app/Section.php | 21 -- app/ShippingGroup.php | 26 -- app/ShippingMethod.php | 22 -- app/ShippingRule.php | 30 -- app/ShoppingCart.php | 48 --- app/SimpleMessage.php | 11 - app/Site.php | 29 -- app/SiteConfig.php | 82 ----- app/SmsPanel.php | 31 -- app/SocialMedia.php | 17 -- app/SpFacility.php | 24 -- app/SpFacilityType.php | 14 - app/SpFrame.php | 96 ------ app/SpFrameType.php | 25 -- app/SpLink.php | 22 -- app/SpMasterTemplate.php | 18 -- app/SpPage.php | 26 -- app/SpPageType.php | 16 - app/SpSection.php | 31 -- app/SpTemplate.php | 80 ----- app/SpUserElement.php | 53 ---- app/SpUserFacility.php | 21 -- app/SpUserFrame.php | 134 --------- app/SpUserPage.php | 90 ------ app/SpUserTemplate.php | 78 ----- app/SpecialContent.php | 20 -- app/SpecialContentOption.php | 56 ---- app/Staff.php | 19 -- app/Strategy.php | 24 -- app/Tag.php | 47 --- app/TagGroup.php | 23 -- app/Task.php | 78 ----- app/TempBusiness.php | 76 ----- app/Transaction.php | 32 -- app/TransactionLog.php | 18 -- app/Upload.php | 24 -- app/Uploadable.php | 26 -- app/UploadableLast.php | 26 -- app/UploadableNew.php | 26 -- app/User.php | 210 ------------- app/UserTransaction.php | 19 -- app/WmItem.php | 40 --- app/WmItemsCategory.php | 25 -- app/WmPackage.php | 24 -- composer.json | 1 + composer.lock | 261 ++++++++-------- config/modules.php | 188 ------------ ...9_09_05_192945_add_load_in_home_column.php | 31 ++ database/seeds/DatabaseSeeder.php | 3 +- routes/api.php | 3 - 107 files changed, 172 insertions(+), 4719 deletions(-) delete mode 100644 app/Address.php delete mode 100644 app/Attribute.php delete mode 100644 app/AttributeValue.php delete mode 100644 app/Auction.php delete mode 100644 app/BatchShoppingCart.php delete mode 100644 app/Blog.php delete mode 100644 app/BlogCategory.php delete mode 100644 app/Brand.php delete mode 100644 app/Business.php delete mode 100644 app/BusinessItem.php delete mode 100644 app/BusinessItemVariation.php delete mode 100644 app/BusinessTitle.php delete mode 100644 app/Category.php delete mode 100644 app/CategoryTempBusiness.php delete mode 100644 app/ChatMessage.php delete mode 100644 app/City.php delete mode 100644 app/Client.php delete mode 100644 app/Comment.php delete mode 100644 app/ContactMessage.php delete mode 100644 app/Conversation.php delete mode 100644 app/Cooperation.php delete mode 100644 app/CooperationData.php delete mode 100644 app/CrmEvent.php delete mode 100644 app/Data.php delete mode 100644 app/District.php delete mode 100644 app/EmplQuestion.php delete mode 100644 app/EmplResults.php delete mode 100644 app/Event.php delete mode 100644 app/Faq.php delete mode 100644 app/FaqCategory.php delete mode 100644 app/Feedback.php delete mode 100644 app/Finance.php delete mode 100644 app/Gallery.php delete mode 100644 app/GalleryLast.php delete mode 100644 app/GalleryNew.php delete mode 100644 app/Gift.php delete mode 100644 app/Help.php delete mode 100644 app/HelpCategory.php delete mode 100644 app/Language.php delete mode 100644 app/Like.php delete mode 100644 app/Message.php delete mode 100644 app/News.php delete mode 100644 app/Offer.php delete mode 100644 app/Option.php delete mode 100644 app/Order.php delete mode 100644 app/OrderItem.php delete mode 100644 app/Payment.php delete mode 100644 app/Permission.php delete mode 100644 app/Portfolio.php delete mode 100644 app/Post.php delete mode 100644 app/Product.php delete mode 100644 app/ProductDetail.php delete mode 100644 app/Project.php delete mode 100644 app/Promotion.php delete mode 100644 app/Reservation.php delete mode 100644 app/Role.php delete mode 100644 app/RollCall.php delete mode 100644 app/Section.php delete mode 100644 app/ShippingGroup.php delete mode 100644 app/ShippingMethod.php delete mode 100644 app/ShippingRule.php delete mode 100644 app/ShoppingCart.php delete mode 100644 app/SimpleMessage.php delete mode 100644 app/Site.php delete mode 100644 app/SiteConfig.php delete mode 100644 app/SmsPanel.php delete mode 100644 app/SocialMedia.php delete mode 100644 app/SpFacility.php delete mode 100644 app/SpFacilityType.php delete mode 100644 app/SpFrame.php delete mode 100644 app/SpFrameType.php delete mode 100644 app/SpLink.php delete mode 100644 app/SpMasterTemplate.php delete mode 100644 app/SpPage.php delete mode 100644 app/SpPageType.php delete mode 100644 app/SpSection.php delete mode 100644 app/SpTemplate.php delete mode 100644 app/SpUserElement.php delete mode 100644 app/SpUserFacility.php delete mode 100644 app/SpUserFrame.php delete mode 100644 app/SpUserPage.php delete mode 100644 app/SpUserTemplate.php delete mode 100644 app/SpecialContent.php delete mode 100644 app/SpecialContentOption.php delete mode 100644 app/Staff.php delete mode 100644 app/Strategy.php delete mode 100644 app/Tag.php delete mode 100644 app/TagGroup.php delete mode 100644 app/Task.php delete mode 100644 app/TempBusiness.php delete mode 100644 app/Transaction.php delete mode 100644 app/TransactionLog.php delete mode 100644 app/Upload.php delete mode 100644 app/Uploadable.php delete mode 100644 app/UploadableLast.php delete mode 100644 app/UploadableNew.php delete mode 100644 app/User.php delete mode 100644 app/UserTransaction.php delete mode 100644 app/WmItem.php delete mode 100644 app/WmItemsCategory.php delete mode 100644 app/WmPackage.php delete mode 100644 config/modules.php create mode 100644 database/migrations/2019_09_05_192945_add_load_in_home_column.php diff --git a/app/Address.php b/app/Address.php deleted file mode 100644 index 4576114..0000000 --- a/app/Address.php +++ /dev/null @@ -1,26 +0,0 @@ -morphTo(); - } - - public function city () - { - return $this->belongsTo('App\City'); - } - -} diff --git a/app/Attribute.php b/app/Attribute.php deleted file mode 100644 index 6798aa6..0000000 --- a/app/Attribute.php +++ /dev/null @@ -1,34 +0,0 @@ -hasMany('App\AttributeValue'); - } - - public function category() - { - return $this->belongsTo('App\Category'); - } - - public function businesses() - { - return $this->belongsToMany('App\Business'); - } - - public function products() - { - return $this->belongsToMany('App\Product'); - } - -} diff --git a/app/AttributeValue.php b/app/AttributeValue.php deleted file mode 100644 index edaf73c..0000000 --- a/app/AttributeValue.php +++ /dev/null @@ -1,18 +0,0 @@ -belongsTo('App\Attribute'); - } - -} diff --git a/app/Auction.php b/app/Auction.php deleted file mode 100644 index 22df269..0000000 --- a/app/Auction.php +++ /dev/null @@ -1,23 +0,0 @@ -hasMany('App\Order'); - } - - public function business_item_variation () - { - return $this->belongsTo('App\BusinessItemVariation'); - } - -} diff --git a/app/BatchShoppingCart.php b/app/BatchShoppingCart.php deleted file mode 100644 index 51c79b2..0000000 --- a/app/BatchShoppingCart.php +++ /dev/null @@ -1,27 +0,0 @@ -attributes['details'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - public function getDetailsAttribute() - { - return json_decode($this->attributes['details']); - } - - public function shopping_carts() - { - return $this->hasMany('App\ShoppingCart'); - } - -} diff --git a/app/Blog.php b/app/Blog.php deleted file mode 100644 index 98769a1..0000000 --- a/app/Blog.php +++ /dev/null @@ -1,74 +0,0 @@ -morphToMany('App\Gallery', 'uploadable'); - } - - public function category() - { - return $this->belongsTo('App\BlogCategory', 'blog_category_id'); - } - - public function categories() - { - return $this->belongsToMany('App\BlogCategory', 'blog_blog_category'); - } - - public function user() - { - return $this->belongsTo('App\User'); - } - - public function likes() - { - return $this->morphMany('App\Like', 'likeable'); - } - - public function comments() - { - return $this->morphMany('App\Comment', 'commentable'); - } - - public function tags() - { - return $this->morphToMany('App\Tag', 'taggable'); - } - - public function orginalTitleImage() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function title_image() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function tiny_images() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TinyImages')->where('parent_id', null); - } - - public function getTotalLikesAttribute() - { - return $this->morphMany('App\Like', 'likeable')->count(); - } - - public function setUserIdAttribute($value) - { - $this->attributes['user_id'] = \Auth::user()->id; - } -} diff --git a/app/BlogCategory.php b/app/BlogCategory.php deleted file mode 100644 index 125fae2..0000000 --- a/app/BlogCategory.php +++ /dev/null @@ -1,30 +0,0 @@ -belongsTo('App\BlogCategory', 'parent_id'); - } - - public function children() - { - return $this->hasMany('App\BlogCategory', 'parent_id'); - } - - public function blogs() - { - return $this->belongsToMany('App\Blog','blog_blog_category'); - } - -} diff --git a/app/Brand.php b/app/Brand.php deleted file mode 100644 index 0b4b508..0000000 --- a/app/Brand.php +++ /dev/null @@ -1,29 +0,0 @@ -belongsToMany('App\Category'); - } - - public function business_items() - { - return $this->hasMany('App\BusinessItem'); - } - - public function products() - { - return $this->hasMany('App\Product'); - } - -} diff --git a/app/Business.php b/app/Business.php deleted file mode 100644 index f46eb65..0000000 --- a/app/Business.php +++ /dev/null @@ -1,279 +0,0 @@ -check() && $this->likes()->get()) { - foreach ($this->likes()->get() as $like) { - if (auth()->user()->id === $like->user_id) - return true; - } - return false; - } - return false; - } - - public function setDetailsAttribute($value) - { - $this->attributes['details'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - public function setFeaturesAttribute($value) - { - $this->attributes['features'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - public function setPhonesAttribute($value) - { - $this->attributes['phones'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - - public function getPhonesAttribute() - { - return json_decode($this->attributes['phones']); - } - - public function getDetailsAttribute() - { - $details = json_decode($this->attributes['details']); - if ($details and isset($details->PaymentMethods)) { - $configMethods = config('SPconf.PaymentMethods'); - $methods = []; - foreach ($details->PaymentMethods as $PaymentMethod) { - if (array_has($configMethods, $PaymentMethod)) { - $methods[$PaymentMethod] = $configMethods[$PaymentMethod]; - } - } - $details->PaymentMethods = $methods; - } - return $details; - } - - public function getFeaturesAttribute() - { - return json_decode($this->attributes['features']); - } - - public function business_items() - { - return $this->hasMany('App\BusinessItem'); - } - - public function verified_business_items() - { - return $this->hasMany('App\BusinessItem')->where('verification', 1); - } - - public function portfolios() - { - return $this->hasMany('App\Portfolio'); - } - - public function contact_messages() - { - return $this->hasMany('App\ContactMessage'); - } - - public function reservations() - { - return $this->hasMany('App\Reservation'); - } - - public function business_title() - { - return $this->belongsTo('App\BusinessTitle'); - } - - public function addresses() - { - return $this->morphMany('App\Address', 'addressable'); - } - - public function user() - { - return $this->belongsTo('App\User'); - } - - public function categories() - { - return $this->belongsToMany('App\Category')->withTimestamps(); - } - - public function category() - { - return $this->belongsTo('App\Category'); - } - - public function shopping_carts() - { - return $this->hasMany('App\ShoppingCart'); - } - - public function orders() - { - return $this->hasMany('App\Order'); - } - - public function city() - { - return $this->belongsTo('App\City'); - } - - public function district() - { - return $this->belongsTo('App\District'); - } - - public function data() - { - return $this->hasMany('App\Data'); - } - - public function template() - { - return $this->hasMany('App\SpUserTemplate'); - } - - public function user_templates() - { - return $this->hasMany('App\SpUserTemplate'); - } - - public function tags() - { - return $this->morphToMany('App\Tag', 'taggable'); - } - - public function news() - { - return $this->hasMany('App\News'); - } - - public function likes() - { - return $this->morphMany('App\Like', 'likeable'); - } - - public function toSearchableArray() - { - return [ - 'id' => $this->id, - 'brand_en' => $this->brand_en, - 'brand_fa' => $this->brand_fa, - 'city_id' => $this->city_id, - ]; - } - - /** - * Get all of the post's comments. - */ - public function comments() - { - return $this->morphMany('App\Comment', 'commentable')->orderBy('updated_at', 'desc'); - } - - public function feedbacks() - { - return $this->morphMany('App\Feedback', 'feedbackable')->orderBy('updated_at', 'desc'); - } - - public function members() - { - return $this->belongsToMany('App\user', 'business_has_user', 'business_id', 'user_id'); - } - - public function orginalImages() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function files() - { - return $this->hasMany('App\Gallery')->where('parent_id', null); - } - - public function gallery() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'Gallery')->where('parent_id', null); - } - - public function title_image() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'logo')->where('parent_id', null); - } - - public function orginalLogo() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'logo')->where('parent_id', null); - } - - public function logo() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'logo')->where('parent_id', null); - } - - public function orginalBanner() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'banner')->where('parent_id', null); - } - - public function banner() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'banner')->where('parent_id', null); - } - - public function special_content_options() - { - return $this->morphMany('App\SpecialContentOption', 'special_content_optionable'); - } - - public function social_media() - { - return $this->hasOne('App\SocialMedia'); - } - - public function events() - { - return $this->hasMany('App\Event'); - } - - public function attributes() - { - return $this->belongsToMany('App\Attribute'); - } - -} diff --git a/app/BusinessItem.php b/app/BusinessItem.php deleted file mode 100644 index 60931ff..0000000 --- a/app/BusinessItem.php +++ /dev/null @@ -1,186 +0,0 @@ -belongsTo('App\Category'); - } - - public function brand() - { - return $this->belongsTo('App\Brand'); - } - - public function city() - { - return $this->belongsTo('App\City'); - } - - public function district() - { - return $this->belongsTo('App\District'); - } - - public function business() - { - return $this->belongsTo('App\Business'); - } - - public function product() - { - return $this->belongsTo('App\Product'); - } - - public function comments() - { - return $this->morphMany('App\Comment', 'commentable'); - } - - public function feedbacks() - { - return $this->morphMany('App\Feedback', 'feedbackable')->orderBy('updated_at', 'desc'); - } - - - public function offer() - { - return $this->hasMany('App\Offer'); - } - - public function first_variation() - { - return $this->hasOne('App\BusinessItemVariation'); - } - - public function business_item_variations() - { - return $this->hasMany('App\BusinessItemVariation'); - } - - public function user_frames() - { - return $this->morphToMany('App\\SpUserFrame', 'element', 'sp_user_elements'); - } - - public function user() - { - return $this->belongsTo('App\User'); - } - - - public function tags() - { - return $this->morphToMany('App\Tag', 'taggable'); - } - - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function orginalTitleImage() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function title_image() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function gallery() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'Gallery')->where('parent_id', null); - } - - public function likes() - { - return $this->morphMany('App\Like', 'likeable'); - } - - public function gifts() - { - return $this->hasMany('App\Gift', 'business_item_self_id'); - } - - public function special_content_options() - { - return $this->morphMany('App\SpecialContentOption', 'special_content_optionable'); - } - - public function getDescriptionAttribute() - { - if ($this->product && $this->product->detail && $this->product->detail->description) { - return $this->product->detail->description . "\n" . $this->attributes['description']; - } else { - return $this->attributes['description']; - } - } - - public function getThumbnailAttribute() - { - if ($this->title_image->isNotEmpty()) { - return $this->title_image->first()->path; - } elseif ($this->product() && $this->product && $this->product->title_image->first()) { - return $this->product->title_image->first()->path; - } - return 'WM-Main/Assets/NoPreview/preview.png'; - } - - public function getImagePathAttribute() - { - if ($this->title_image->isNotEmpty()) { - return $this->title_image->first()->path; - } elseif ($this->product() && $this->product && $this->product->title_image->first()) { - return $this->product->title_image->first()->path; - } - return 'WM-Main/Assets/NoPreview/preview.png'; - } - - public function setDetailLink($value) - { - $this->linkToDetail = "{$value}/{$this->id}"; - } - - public function options() - { - return $this->belongsToMany('App\Option'); - } -} diff --git a/app/BusinessItemVariation.php b/app/BusinessItemVariation.php deleted file mode 100644 index 80802f4..0000000 --- a/app/BusinessItemVariation.php +++ /dev/null @@ -1,51 +0,0 @@ -belongsTo('App\BusinessItem'); - } - - public function shopping_carts () - { - return $this->morphMany('App\ShoppingCart', 'payable'); - } - - public function offers () - { - return $this->hasMany('App\Offer'); - } - - public function orders () - { - return $this->hasMany('App\Order'); - } - - public function auction () - { - return $this->hasOne('App\Auction'); - } - - public function business () - { - return $this->belongsTo('App\Business'); - } - - public function getDescriptionAttribute () - { - return json_decode($this->attributes['description']); - } - - public function setDescriptionAttribute ($value) - { - $this->attributes['description'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } -} diff --git a/app/BusinessTitle.php b/app/BusinessTitle.php deleted file mode 100644 index c3d69fb..0000000 --- a/app/BusinessTitle.php +++ /dev/null @@ -1,38 +0,0 @@ -hasMany('App\Business'); - } - - public function category() - { - return $this->belongsTo('App\Category'); - } - - public function setDetailsAttribute($value) - { - $this->attributes['details'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - public function getDetailsAttribute() - { - return json_decode($this->attributes['details']); - } - - protected function clearCacheItems(){ - Cache::forget('business_title'); - } -} diff --git a/app/Category.php b/app/Category.php deleted file mode 100644 index bd7b352..0000000 --- a/app/Category.php +++ /dev/null @@ -1,122 +0,0 @@ -belongsTo('App\Category', 'parent_id'); - } - - public function business_title() - { - return $this->hasMany('App\BusinessTitle'); - } - - public function attributes() - { - return $this->hasMany('App\Attribute'); - } - - public function order_variation() - { - return $this->belongsToMany('App\Attribute')->where('for_section', 'Order'); - } - - public function children() - { - return $this->hasMany('App\Category', 'parent_id'); - } - - public function products() - { - return $this->hasMany('App\Product'); - } - - public function brands() - { - return $this->belongsToMany('App\Brand'); - } - - public function business_categories() - { - return $this->belongsToMany('App\Business'); - } - - public function business() - { - return $this->hasMany('App\Business'); - } - - public function business_items() - { - return $this->hasMany('App\BusinessItem'); - } - - public function templates() - { - return $this->hasMany('App\SpTemplate'); - } - - public function user_templates() - { - return $this->hasManyThrough('App\SpUserTemplate', 'App\SpTemplate', 'category_id', 'sp_template_id', 'id', 'id'); - } - - - ////////////// - public function c_attributes() - { - return $this->belongsToMany('App\Attribute', 'attribute_category'); - } - - public function news() - { - return $this->belongsToMany('App\News'); - } - - public function businesses() - { - return $this->belongsToMany('App\Business'); - } - - public function portfolios() - { - return $this->hasMany('App\Portfolio'); - } - - public function shipping_groups() - { - return $this->belongsToMany('App\ShippingGroup'); - } - public function shipping_group_business() - { - return $this->belongsToMany('App\ShippingGroup')->where('business_id', session('ActiveBusiness')); - } - - //override action methods and delete caches - - - protected function clearCacheItems() - { -// dd('rrrr/rrrrun'); - Cache::forget('main_categories'); - } - - protected function updateRelatedFiles() - { - - } -} diff --git a/app/CategoryTempBusiness.php b/app/CategoryTempBusiness.php deleted file mode 100644 index 7ff36c6..0000000 --- a/app/CategoryTempBusiness.php +++ /dev/null @@ -1,12 +0,0 @@ -hasMany('App\Address'); - } - - public function business_items () - { - return $this->hasMany('App\BusinessItem'); - } - - public function businesss () - { - return $this->hasMany('App\Business'); - } - - public function districts () - { - return $this->hasMany('App\District'); - } - - public function destination_orders () - { - return $this->hasMany('App\Orders', 'destination_city_id'); - } - - public function source_orders () - { - return $this->hasMany('App\Orders', 'source_city_id'); - } - - public function parent() - { - return $this->belongsTo('App\City', 'parent_id'); - } - public function children() - { - return $this->hasMany('App\City', 'parent_id'); - } - - public function cities () - { - return $this->hasMany('App\City', 'parent_id'); - } - - public function province () - { - return $this->belongsTo('App\City', 'parent_id'); - } - protected function clearCacheItems(){ - Cache::forget('cities'); - } - -} diff --git a/app/Client.php b/app/Client.php deleted file mode 100644 index 603c6d1..0000000 --- a/app/Client.php +++ /dev/null @@ -1,38 +0,0 @@ -created_at = $model->freshTimestamp(); - }); - } - - public function setBirthDateAttribute($value) - { - if ($value) { - $this->attributes['birth_date'] = \Carbon\Carbon::createFromFormat('Y-m-d', $value)->toDateTimeString(); - } - } - - public function setDetailsAttribute($value) - { - $this->attributes['details'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - public function getDetailsAttribute() - { - return json_decode($this->attributes['details']); - } - -} diff --git a/app/Comment.php b/app/Comment.php deleted file mode 100644 index 53c772a..0000000 --- a/app/Comment.php +++ /dev/null @@ -1,25 +0,0 @@ -belongsTo('App\User')->select(['id','name']); - } - - public function commentable() - { - return $this->morphTo(); - } - -} diff --git a/app/ContactMessage.php b/app/ContactMessage.php deleted file mode 100644 index 10a0d80..0000000 --- a/app/ContactMessage.php +++ /dev/null @@ -1,25 +0,0 @@ -attributes['data'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - public function getDataAttribute() - { - return json_decode($this->attributes['data']); - } - - public function business() - { - return $this->belongsTo('App\Business'); - } -} diff --git a/app/Conversation.php b/app/Conversation.php deleted file mode 100644 index 80f4b3f..0000000 --- a/app/Conversation.php +++ /dev/null @@ -1,30 +0,0 @@ -hasMany('App\Message'); - } - - public function userone() - { - return $this->belongsTo('App\User', 'user_one_id')->select('id', 'name', 'last_activity'); - } - - public function usertwo() - { - return $this->belongsTo('App\User', 'user_two_id')->select('id', 'name', 'last_activity'); - } -} diff --git a/app/Cooperation.php b/app/Cooperation.php deleted file mode 100644 index e2e5616..0000000 --- a/app/Cooperation.php +++ /dev/null @@ -1,38 +0,0 @@ -belongsTo('App\User')->select(['name','id','detail','birthday','cell_number','email']); - } - public function FormData() - { - return $this->hasMany('App\CooperationData', 'type_id') - ->where('model_type' , 'App\Cooperation'); - } - public function UserData() - { - return $this->hasMany('App\CooperationData', 'type_id')->where('model_type' , 'App\\User'); - } - - public function setAppointmentAttribute($value) - { - $carbon = new Carbon(); - $date = substr($value, 0, -3); - $date = $carbon->timestamp($date)->timezone('Asia/Tehran')->toDateString(); - $this->attributes['appointment'] = $date; - } - - } -?> diff --git a/app/CooperationData.php b/app/CooperationData.php deleted file mode 100644 index de9facd..0000000 --- a/app/CooperationData.php +++ /dev/null @@ -1,34 +0,0 @@ -attributes['data']); - } - - public function setDataAttribute($value) - { - $this->attributes['data'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - public static function getFormData($model_id,$model_type){ - $coop = CooperationData::where('model_type' , $model_type)->where('type_id' , $model_id); - if ($coop->get()){ - return $coop->get(); - }return []; - } - public static function lgn($value){ - $ex = explode ('Common_',$value); - if (count ($ex) > 1){ - return trans ("validation.attributes.{$ex[1]}"); - } - return trans ("validation.attributes.{$value}"); - } - } diff --git a/app/CrmEvent.php b/app/CrmEvent.php deleted file mode 100644 index d35202f..0000000 --- a/app/CrmEvent.php +++ /dev/null @@ -1,41 +0,0 @@ -belongsTo('App\User')->select(['id', 'name']); - } - - public function getDateAttribute() - { - $carbon = new Carbon($this->attributes['date']); - return $carbon; - } - public function setDateAttribute($value) - { - $carbon = new Carbon(); - $date = substr($value, 0, -3); - $date = $carbon->timestamp($date)->timezone('Asia/Tehran')->toDateString(); - $this->attributes['date'] = $date; - } - public function setPropertyAttribute($value){ - $this->attributes['property'] = json_encode($value); - } - public function getPropertyAttribute(){ - return json_decode($this->attributes['property']); - } - public function setUserIdAttribute(){ - $this->attributes['user_id'] = auth()->user()->id; - } -} diff --git a/app/Data.php b/app/Data.php deleted file mode 100644 index d8a3ac0..0000000 --- a/app/Data.php +++ /dev/null @@ -1,21 +0,0 @@ -hasOne('App\Element'); - } - public function business() - { - return $this->belongsTo('App\Business'); - } - -} diff --git a/app/District.php b/app/District.php deleted file mode 100644 index 9b3cc4b..0000000 --- a/app/District.php +++ /dev/null @@ -1,30 +0,0 @@ -belongsTo('App\City'); - } - - public function business_items () - { - return $this->hasMany('App\BusinessItem'); - } - - public function businesss () - { - return $this->hasMany('App\Business'); - } - -} diff --git a/app/EmplQuestion.php b/app/EmplQuestion.php deleted file mode 100644 index c05af38..0000000 --- a/app/EmplQuestion.php +++ /dev/null @@ -1,21 +0,0 @@ -attributes['questions_list']); - } - - public function setQuestionsListAttribute($value) - { - $this->attributes['questions_list'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } -} diff --git a/app/EmplResults.php b/app/EmplResults.php deleted file mode 100644 index 8056b28..0000000 --- a/app/EmplResults.php +++ /dev/null @@ -1,29 +0,0 @@ -attributes['result']); - } - - public function setResultAttribute($value) - { - $this->attributes['result'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - public function Question() - { - return $this->belongsTo('App\EmplQuestion','question_id'); - } - public function User() - { - return $this->belongsTo('App\User','user_id')->select(['name','id','detail','birthday','cell_number','email']); - } -} diff --git a/app/Event.php b/app/Event.php deleted file mode 100644 index 84bba67..0000000 --- a/app/Event.php +++ /dev/null @@ -1,45 +0,0 @@ -morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'banner'); - } - - public function orginalTitleImage() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'banner')->where('parent_id', null); - } - - public function title_image() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'banner')->where('parent_id', null); - } - - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function tags() - { - return $this->morphToMany('App\Tag', 'taggable'); - } - - public function business() - { - return $this->belongsTo('App\Business'); - } - -} diff --git a/app/Faq.php b/app/Faq.php deleted file mode 100644 index 97a1355..0000000 --- a/app/Faq.php +++ /dev/null @@ -1,25 +0,0 @@ -belongsTo('App\FaqCategory'); - } - - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function tiny_images() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TinyImages')->where('parent_id', null); - } - -} diff --git a/app/FaqCategory.php b/app/FaqCategory.php deleted file mode 100644 index 2280dce..0000000 --- a/app/FaqCategory.php +++ /dev/null @@ -1,15 +0,0 @@ -hasMany('App\Faq'); - } - -} diff --git a/app/Feedback.php b/app/Feedback.php deleted file mode 100644 index bfb16fc..0000000 --- a/app/Feedback.php +++ /dev/null @@ -1,27 +0,0 @@ -morphTo(); - } - - public function author() - { - /// Select ID , Name , ProfilePhoto - /// Change By Saleh - return $this->belongsTo('App\User','author_id')->select(['id','name']); - } - -} diff --git a/app/Finance.php b/app/Finance.php deleted file mode 100644 index 5c25f91..0000000 --- a/app/Finance.php +++ /dev/null @@ -1,15 +0,0 @@ - 'array']; - - public function usages() - { - return $this->hasMany('App\Uploadable', 'gallery_id', 'id'); - } - - public function roles() - { - return $this->hasMany('App\Uploadable', 'gallery_id', 'id'); - } - - public function parent() - { - return $this->belongsTo('App\Gallery', 'parent_id'); - } - - public function children() - { - return $this->hasMany('App\Gallery', 'parent_id', 'id'); - } - - public function businessitem() - { - return $this->morphedByMany('App\BusinessItem', 'uploadable'); - } - - public function business_item() - { - return $this->morphedByMany('App\BusinessItem', 'uploadable'); - } - - public function business_items() - { - return $this->morphedByMany('App\BusinessItem', 'uploadable'); - } - - public function businessRole($role = 'Gallery') - { - return $this->morphedByMany('App\Business', 'uploadable')->wherePivot('image_role', $role); - } - - public function portfolios() - { - return $this->morphedByMany('App\Portfolio', 'uploadable'); - } - - public function portfolio() - { - return $this->morphedByMany('App\Portfolio', 'uploadable'); - } - public function projects() - { - return $this->morphedByMany('App\Project', 'uploadable'); - } - - public function project() - { - return $this->morphedByMany('App\Project', 'uploadable'); - } - - public function product() - { - return $this->morphedByMany('App\Product', 'uploadable'); - } - - public function frames() - { - return $this->morphedByMany('App\SpUserFrame', 'uploadable'); - } - - public function elements() - { - return $this->morphedByMany('App\SpUserElement', 'uploadable'); - } - - public function business() - { - return $this->belongsTo('App\Business', 'business_id', 'id'); - } - - public function getImageRoleAttribute() - { - return $this->pivot->image_role; - } - -} diff --git a/app/GalleryLast.php b/app/GalleryLast.php deleted file mode 100644 index cb8e20f..0000000 --- a/app/GalleryLast.php +++ /dev/null @@ -1,90 +0,0 @@ - 'array']; - - public function usages() - { - return $this->hasMany('App\UploadableLast', 'gallery_id', 'id'); - } - - public function roles() - { - return $this->hasMany('App\UploadableLast', 'gallery_id', 'id'); - } - - public function parent() - { - return $this->belongsTo('App\GalleryLast', 'parent_id'); - } - - public function children() - { - return $this->hasMany('App\GalleryLast', 'parent_id', 'id'); - } - - public function businessitem() - { - return $this->morphedByMany('App\BusinessItem', 'uploadable'); - } - - public function business_item() - { - return $this->morphedByMany('App\BusinessItem', 'uploadable'); - } - - public function business_items() - { - return $this->morphedByMany('App\BusinessItem', 'uploadable'); - } - - public function businessRole($role = 'Gallery') - { - return $this->morphedByMany('App\Business', 'uploadable')->wherePivot('image_role', $role); - } - - public function portfolios() - { - return $this->morphedByMany('App\Portfolio', 'uploadable'); - } - - public function portfolio() - { - return $this->morphedByMany('App\Portfolio', 'uploadable'); - } - - public function product() - { - return $this->morphedByMany('App\Product', 'uploadable'); - } - - public function frames() - { - return $this->morphedByMany('App\SpUserFrame', 'uploadable'); - } - - public function elements() - { - return $this->morphedByMany('App\SpUserElement', 'uploadable'); - } - - public function business() - { - return $this->belongsTo('App\Business', 'business_id', 'id'); - } - - public function getImageRoleAttribute() - { - return $this->pivot->image_role; - } - -} diff --git a/app/GalleryNew.php b/app/GalleryNew.php deleted file mode 100644 index 9984999..0000000 --- a/app/GalleryNew.php +++ /dev/null @@ -1,90 +0,0 @@ - 'array']; - - public function usages() - { - return $this->hasMany('App\UploadableNew', 'gallery_id', 'id'); - } - - public function roles() - { - return $this->hasMany('App\UploadableNew', 'gallery_id', 'id'); - } - - public function parent() - { - return $this->belongsTo('App\GalleryNew', 'parent_id'); - } - - public function children() - { - return $this->hasMany('App\GalleryNew', 'parent_id', 'id'); - } - - public function businessitem() - { - return $this->morphedByMany('App\BusinessItem', 'uploadable'); - } - - public function business_item() - { - return $this->morphedByMany('App\BusinessItem', 'uploadable'); - } - - public function business_items() - { - return $this->morphedByMany('App\BusinessItem', 'uploadable'); - } - - public function businessRole($role = 'Gallery') - { - return $this->morphedByMany('App\Business', 'uploadable')->wherePivot('image_role', $role); - } - - public function portfolios() - { - return $this->morphedByMany('App\Portfolio', 'uploadable'); - } - - public function portfolio() - { - return $this->morphedByMany('App\Portfolio', 'uploadable'); - } - - public function product() - { - return $this->morphedByMany('App\Product', 'uploadable'); - } - - public function frames() - { - return $this->morphedByMany('App\SpUserFrame', 'uploadable'); - } - - public function elements() - { - return $this->morphedByMany('App\SpUserElement', 'uploadable'); - } - - public function business() - { - return $this->belongsTo('App\Business', 'business_id', 'id'); - } - - public function getImageRoleAttribute() - { - return $this->pivot->image_role; - } - -} diff --git a/app/Gift.php b/app/Gift.php deleted file mode 100644 index 6d9b853..0000000 --- a/app/Gift.php +++ /dev/null @@ -1,14 +0,0 @@ -belongsTo('App\BusinessItem'); - } -} diff --git a/app/Help.php b/app/Help.php deleted file mode 100644 index 0abf1c2..0000000 --- a/app/Help.php +++ /dev/null @@ -1,24 +0,0 @@ -belongsTo('App\HelpCategory','help_category_id'); - } - public function tiny_images() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TinyImages')->where('parent_id', null); - } - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable')->where('parent_id', null); - } -} diff --git a/app/HelpCategory.php b/app/HelpCategory.php deleted file mode 100644 index be15c82..0000000 --- a/app/HelpCategory.php +++ /dev/null @@ -1,16 +0,0 @@ -hasMany('App\Help'); - } -} diff --git a/app/Language.php b/app/Language.php deleted file mode 100644 index 8d409da..0000000 --- a/app/Language.php +++ /dev/null @@ -1,13 +0,0 @@ -hasMany('App\\SpUserTemplate','default_language_id'); - } - -} diff --git a/app/Like.php b/app/Like.php deleted file mode 100644 index d348523..0000000 --- a/app/Like.php +++ /dev/null @@ -1,18 +0,0 @@ -morphTo(); - } - -} diff --git a/app/Message.php b/app/Message.php deleted file mode 100644 index ea539ef..0000000 --- a/app/Message.php +++ /dev/null @@ -1,40 +0,0 @@ -created_at; - $now = $date->now(); - - return $date->diffForHumans($now, true); - } - - - public function conversation() - { - return $this->belongsTo('App\Conversation'); - } - - public function user() - { - return $this->belongsTo('App\User'); - } -} diff --git a/app/News.php b/app/News.php deleted file mode 100644 index c41a453..0000000 --- a/app/News.php +++ /dev/null @@ -1,90 +0,0 @@ -belongsToMany('App\Category'); - return $this->belongsToMany('App\Category', 'category_news', 'news_id', 'category_id'); - - } - - public function user_frames() - { - return $this->morphToMany('App\\SpUserFrame', 'element', 'sp_user_elements'); - } - - public function business() - { - return $this->belongsTo('App\Business'); -// return $this->belongsToMany('App\Category','category_news','news_id','category_id'); - - } - - public function files() - { - return $this->morphMany('App\Upload', 'uploadable')->select('id', 'uploadable_id', 'uploadable_type', 'user_id', 'path'); - } - - - public function gallery() - { - return $this->morphMany('App\Upload', 'uploadable')->where('file_role', 1); - } - - /** - * Get all of the post's comments. - */ - public function comments() - { - return $this->morphMany('App\Comment', 'commentable'); - } - - public function orginalTitleImage() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function title_image() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function tags() - { - return $this->morphToMany('App\Tag', 'taggable'); - } - - public function tiny_images() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TinyImages')->where('parent_id', null); - } - - public function getThumbnailAttribute() - { - if ($this->title_image->isNotEmpty()) { - return $this->title_image->first()->path; - } - return 'WM-Main/Assets/NoPreview/preview.png'; - } - - public function setDetailLink($value) - { - $this->linkToDetail = "{$value}/{$this->id}"; - } -} diff --git a/app/Offer.php b/app/Offer.php deleted file mode 100644 index fa5c415..0000000 --- a/app/Offer.php +++ /dev/null @@ -1,19 +0,0 @@ -belongsTo('App\User','proposer_id'); - } - public function business_item_variation() - { - return $this->belongsTo('App\BusinessItemVariation'); - } - -} diff --git a/app/Option.php b/app/Option.php deleted file mode 100644 index fe33ac3..0000000 --- a/app/Option.php +++ /dev/null @@ -1,24 +0,0 @@ -belongsToMany('App\BusinessItem'); - } - - public function values() - { - return $this->hasMany('App\Option', 'parent_id'); - } - -} diff --git a/app/Order.php b/app/Order.php deleted file mode 100644 index 89b0352..0000000 --- a/app/Order.php +++ /dev/null @@ -1,66 +0,0 @@ -belongsTo('App\Address'); - } - - public function buyer () - { - return $this->belongsTo('App\User', 'buyer_id'); - } - - public function business () - { - return $this->belongsTo('App\Business', 'business_id'); - } - - public function transactions () - { - return $this->belongsTo('App\Transaction'); - } - - public function order_items() - { - return $this->hasMany('App\OrderItem'); - } - - public function setStatusLogsAttribute($value) - { - $this->attributes['status_logs'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - public function getStatusLogsAttribute() - { - return json_decode($this->attributes['status_logs']); - } - - public function setDetailsAttribute($value) - { - $this->attributes['details'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - public function getDetailsAttribute() - { - return json_decode($this->attributes['details']); - } - - -// public function getCreatedAtAttribute($date) -// { -// return \Morilog\Jalali\jDate::forge($date)->format('datetime'); -// } -} diff --git a/app/OrderItem.php b/app/OrderItem.php deleted file mode 100644 index dfb20a1..0000000 --- a/app/OrderItem.php +++ /dev/null @@ -1,51 +0,0 @@ -belongsTo('App\Auction'); - } - - public function business_item_variation() - { - return $this->belongsTo('App\BusinessItemVariation'); - } - - public function order() - { - return $this->belongsTo('App\Order'); - } - - public function getCreatedAtAttribute($date) - { - return \Morilog\Jalali\jDate::forge($date)->format('datetime'); - } - - public function setDetailsAttribute($value) - { - $this->attributes['details'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - public function getDetailsAttribute() - { - return json_decode($this->attributes['details']); - } - - public function getAllPriceAttribute() - { - return $this->attributes['price'] * $this->attributes['quantity']; - } - - public function payable() - { - return $this->morphTo(); - } -} diff --git a/app/Payment.php b/app/Payment.php deleted file mode 100644 index 1c78c7b..0000000 --- a/app/Payment.php +++ /dev/null @@ -1,13 +0,0 @@ -belongsToMany('App\Role'); -// } -} diff --git a/app/Portfolio.php b/app/Portfolio.php deleted file mode 100644 index e2ab95f..0000000 --- a/app/Portfolio.php +++ /dev/null @@ -1,62 +0,0 @@ -belongsTo('App\Business'); - } - - public function category() - { - return $this->belongsTo('App\Category'); - } - - public function orginalTitleImage() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function title_image() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function gallery() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'Gallery')->where('parent_id', null); - } - - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function tags() - { - return $this->morphToMany('App\Tag', 'taggable'); - } - - public function getThumbnailAttribute() - { - if ($this->title_image->isNotEmpty()) { - return $this->title_image->first()->path; - } - return 'WM-Main/Assets/NoPreview/preview.png'; - } - - public function setDetailLink($value) - { - $this->linkToDetail = "{$value}/{$this->id}"; - } - -} diff --git a/app/Post.php b/app/Post.php deleted file mode 100644 index aa816d7..0000000 --- a/app/Post.php +++ /dev/null @@ -1,32 +0,0 @@ -belongsTo('App\User'); - } - public function business_item () - { - return $this->belongsTo('App\BusinessItem'); - } - public function product () - { - return $this->belongsTo('App\Product'); - } - public function user_frames() - { - return $this->morphToMany('App\\SpUserFrame', 'element', 'sp_user_elements'); - } - - -} diff --git a/app/Product.php b/app/Product.php deleted file mode 100644 index 6d5b5a1..0000000 --- a/app/Product.php +++ /dev/null @@ -1,98 +0,0 @@ -belongsTo('App\ProductDetail', 'product_detail_id'); - } - - public function category() - { - return $this->belongsTo('App\Category'); - } - - public function comments() - { - return $this->morphMany('App\Comment', 'commentable'); - } - - public function feedbacks() - { - return $this->morphMany('App\Feedback', 'feedbackable')->orderBy('updated_at', 'desc'); - } - - - public function brand() - { - return $this->belongsTo('App\Brand'); - } - - - public function tags() - { - return $this->morphToMany('App\Tag', 'taggable'); - } - - public function files() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function orginalTitleImage() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function title_image() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function gallery() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'Gallery')->where('parent_id', null); - } - - public function likes() - { - return $this->morphMany('App\Like', 'likeable'); - } - - public function toSearchableArray() - { - return [ - 'id' => $this->id, - 'model_en' => $this->model_en, - 'model_fa' => $this->model_fa, - 'description' => $this->description, - 'author_id' => $this->author_id, - 'brand_id' => $this->brand_id, - 'slug' => $this->slug, - 'category_id' => $this->category_id, - ]; - } - - public function special_content_options() - { - return $this->morphMany('App\SpecialContentOption', 'special_content_optionable'); - } -} diff --git a/app/ProductDetail.php b/app/ProductDetail.php deleted file mode 100644 index 70fc3a3..0000000 --- a/app/ProductDetail.php +++ /dev/null @@ -1,16 +0,0 @@ -hasMany( 'App\Product' ); - } -} diff --git a/app/Project.php b/app/Project.php deleted file mode 100644 index ceefb26..0000000 --- a/app/Project.php +++ /dev/null @@ -1,98 +0,0 @@ -belongsToMany('App\User')->wherePivot('type', 'Responsible'); - } - - public function marketer() - { - return $this->belongsToMany('App\User')->wherePivot('type', 'Marketer'); - } - - public function users() - { - return $this->belongsToMany('App\User'); - } - - public function temp_business() - { - return $this->belongsTo('App\TempBusiness', 'temp_business_id', 'id')->select(['id', 'brand_fa', 'brand_en', 'details', 'phones', 'created_at', 'business_id']); - } - - public function comments() - { - return $this->morphMany('App\Comment', 'commentable')->with('user')->select(["id", "text", "commentable_id", "commentable_type", "user_id", "created_at"]); - } - public function Events() - { - return $this->morphMany('App\CrmEvent', 'eventable')->with('user') - ->select(["id", "title", "text", "date", "user_id" ,"property", "created_at"]); - } - - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function gallery() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'Gallery')->where('parent_id', null); - } - - public function setSpecialFeaturesAttribute($value) - { - $this->attributes['special_features'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - public function getSpecialFeaturesAttribute() - { - return json_decode($this->attributes['special_features']); - } - - public function setBeginDateAttribute($value) - { - $carbon = new Carbon(); - $date = substr($value, 0, -3); - $date = $carbon->timestamp($date)->timezone('Asia/Tehran')->toDateString(); - $this->attributes['begin_date'] = $date; - } - - public function setEndDateAttribute($value) - { - if (!is_null($value)){ - $carbon = new Carbon(); - $date = substr($value, 0, -3); - $date = $carbon->timestamp($date)->timezone('Asia/Tehran')->toDateString(); - $this->attributes['end_date'] = $date; - }else{ - $this->attributes['end_date'] = $value; - } - } - - // public function getBeginDateAttribute() - // { - // return jdate( $this->attributes['begin_date'])->format('y/m/d').' | '.jdate( $this->attributes['begin_date']) - // ->ago(); - // } - // public function getEndDateAttribute() - // { - // return jdate( $this->attributes['end_date'])->format('y/m/d'); - // } -} diff --git a/app/Promotion.php b/app/Promotion.php deleted file mode 100644 index 00a1746..0000000 --- a/app/Promotion.php +++ /dev/null @@ -1,15 +0,0 @@ -morphToMany('App\Gallery', 'uploadable'); - } - -} diff --git a/app/Reservation.php b/app/Reservation.php deleted file mode 100644 index 11ce2b3..0000000 --- a/app/Reservation.php +++ /dev/null @@ -1,22 +0,0 @@ -belongsTo('App\Business'); - } - - public function user() - { - return $this->belongsTo('App\User'); - } - -} diff --git a/app/Role.php b/app/Role.php deleted file mode 100644 index f6533d7..0000000 --- a/app/Role.php +++ /dev/null @@ -1,18 +0,0 @@ -belongsToMany('App\Permission'); -// } - -} diff --git a/app/RollCall.php b/app/RollCall.php deleted file mode 100644 index 2ef6acb..0000000 --- a/app/RollCall.php +++ /dev/null @@ -1,18 +0,0 @@ -attributes['date'])); - } - -} diff --git a/app/Section.php b/app/Section.php deleted file mode 100644 index 7742a6c..0000000 --- a/app/Section.php +++ /dev/null @@ -1,21 +0,0 @@ -hasMany('App\Element'); - } - public function template() -{ - return $this->belongsTo('App\Template'); -} - -} diff --git a/app/ShippingGroup.php b/app/ShippingGroup.php deleted file mode 100644 index 9533f80..0000000 --- a/app/ShippingGroup.php +++ /dev/null @@ -1,26 +0,0 @@ -hasMany('App\ShippingRule'); - } - - public function categories() - { - return $this->belongsToMany('App\Category'); - } - - public function shipping_methods() - { - return $this->belongsToMany('App\ShippingMethod'); - } -} diff --git a/app/ShippingMethod.php b/app/ShippingMethod.php deleted file mode 100644 index 7d664f5..0000000 --- a/app/ShippingMethod.php +++ /dev/null @@ -1,22 +0,0 @@ -belongsToMany('App\ShippingGroup'); - } - - public function getDetailsAttribute() - { - return json_decode($this->attributes['details']); - } - - -} diff --git a/app/ShippingRule.php b/app/ShippingRule.php deleted file mode 100644 index ead1602..0000000 --- a/app/ShippingRule.php +++ /dev/null @@ -1,30 +0,0 @@ -belongsTo('App\ShippingGroup'); - } - - public function getExceptionsAttribute() - { - return json_decode($this->attributes['exceptions']); - } - - public function setExceptionsAttribute($value) - { - if ($value !== null) { - $this->attributes['exceptions'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } else { - $this->attributes['exceptions'] = null; - } - } - -} diff --git a/app/ShoppingCart.php b/app/ShoppingCart.php deleted file mode 100644 index 75bf7f0..0000000 --- a/app/ShoppingCart.php +++ /dev/null @@ -1,48 +0,0 @@ -belongsTo('App\BatchShoppingCart'); - } - public function getDetailsAttribute() - { - return json_decode($this->attributes['details'], true); - } - public function setDetailsAttribute($value) - { - $this->attributes['details'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - public function user() - { - return $this->belongsTo('App\User'); - } - - public function business_item_variation() - { - return $this->belongsTo('App\BusinessItemVariation'); - } - - public function business() - { - return $this->belongsTo('App\Business'); - } - - public function payable() - { - return $this->morphTo(); - } - -} diff --git a/app/SimpleMessage.php b/app/SimpleMessage.php deleted file mode 100644 index 6b1f336..0000000 --- a/app/SimpleMessage.php +++ /dev/null @@ -1,11 +0,0 @@ -belongsTo('App\SpUserTemplate', 'sp_user_template_id'); - } - - public function site_config() - { - return $this->hasOne('App\SiteConfig'); - } - - public function getSiteConfigDefaultOtherAttribute() - { - if (isset($this->site_config->other)) { - return $this->site_config->other; - } else { - return \App\SiteConfig::whereNull('other')->first()->other; - } - } -} diff --git a/app/SiteConfig.php b/app/SiteConfig.php deleted file mode 100644 index 73487db..0000000 --- a/app/SiteConfig.php +++ /dev/null @@ -1,82 +0,0 @@ -belongsTo('App\Site'); - } - - public function getGatewayDataAttribute() - { - return json_decode($this->attributes['gateway_data']); - } - public function setGatewayDataAttribute($value) - { - $this->attributes['gateway_data'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - public function getSmsAttribute() - { - return json_decode($this->attributes['sms']); - } - public function getENamadDataAttribute() - { - return json_decode($this->attributes['e_namad_data']); - } - public function setENamadDataAttribute($value) - { - $this->attributes['e_namad_data'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - public function setSmsAttribute($value) - { - $this->attributes['sms'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - public function getSeoAttribute() - { - return json_decode($this->attributes['seo']); - } - public function setSeoAttribute($value) - { - $this->attributes['seo'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - public function getContactUsAttribute() - { - return json_decode($this->attributes['contact_us']); - } - public function setContactUsAttribute($value) - { - $this->attributes['contact_us'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - public function getOtherAttribute() - { - $other = json_decode($this->attributes['other']); - $other = ($other) ? $other : collect() ; - - $other->LoginColor = (isset($other->LoginColor)) ? $other->LoginColor : 'Cyan'; - $other->LoginImage = (isset($other->LoginImage)) ? $other->LoginImage : 'WM-WebBuilder/Assets/Images/LoginPage.jpg'; - $other->RegisterationColor = (isset($other->RegisterationColor)) ? $other->RegisterationColor : 'Red'; - $other->SMSValidationColor = (isset($other->SMSValidationColor)) ? $other->SMSValidationColor : 'Orange'; - $other->ForgotPasswordColor = (isset($other->ForgotPasswordColor)) ? $other->ForgotPasswordColor : 'Purple'; - $other->ResetPasswordVerificationColor = (isset($other->ResetPasswordVerificationColor)) ? $other->ResetPasswordVerificationColor : 'Black'; - $other->ResetPasswordColor = (isset($other->ResetPasswordColor)) ? $other->ResetPasswordColor : 'Black'; - $other->ManagementHeaderImg = (isset($other->ManagementHeaderImg)) ? $other->ManagementHeaderImg : 'WM-Main/Assets/Uploads/Backgrounds/Admin-BG1.jpg'; - $other->LoaderAddress = (isset($other->LoaderAddress)) ? $other->LoaderAddress : null; - $other->EmptyShoppingCart = (isset($other->EmptyShoppingCart)) ? $other->EmptyShoppingCart : (object) ['URL' => 'WM-Common/Assets/AnimatedIcons/Flower-Once.gif', 'Class' => '']; - $other->EmptyBusinessItem = (isset($other->EmptyBusinessItem)) ? $other->EmptyBusinessItem : (object) ['URL' => 'WM-Common/Assets/AnimatedIcons/Flower-Once.gif', 'Class' => '']; - return $other; - } - public function setOtherAttribute($value) - { - $this->attributes['other'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } -} diff --git a/app/SmsPanel.php b/app/SmsPanel.php deleted file mode 100644 index ee5019e..0000000 --- a/app/SmsPanel.php +++ /dev/null @@ -1,31 +0,0 @@ -belongsTo('App\User'); - } - - public function business() - { - return $this->belongsTo('App\Business'); - } - - public function getTypeFaAttribute() - { - $type = config('WM-Conf.SMSPanelType'); - return isset($type[$this->attributes['type']]) ? $type[$this->attributes['type']] : 'دیگر'; - } - -} diff --git a/app/SocialMedia.php b/app/SocialMedia.php deleted file mode 100644 index fba5908..0000000 --- a/app/SocialMedia.php +++ /dev/null @@ -1,17 +0,0 @@ -hasOne('App\Business'); - } -} - diff --git a/app/SpFacility.php b/app/SpFacility.php deleted file mode 100644 index 5f9fb1a..0000000 --- a/app/SpFacility.php +++ /dev/null @@ -1,24 +0,0 @@ -belongsToMany('App\SpTemplate','facility_template','facility_id','template_id'); - } - - public function user_facilities() - { - return $this->hasMany('App\\SpUserFacility'); - } - - public function facility_type() - { - return $this->belongsTo('App\\SpFacilityType', 'sp_facility_type_id'); - } - -} diff --git a/app/SpFacilityType.php b/app/SpFacilityType.php deleted file mode 100644 index 54d39b9..0000000 --- a/app/SpFacilityType.php +++ /dev/null @@ -1,14 +0,0 @@ -hasMany('App\SpFacility'); - } - -} diff --git a/app/SpFrame.php b/app/SpFrame.php deleted file mode 100644 index fff2f46..0000000 --- a/app/SpFrame.php +++ /dev/null @@ -1,96 +0,0 @@ -belongsTo('App\SpTemplate', 'sp_template_id'); - } - - public function user_pages() - { - return $this->belongsToMany('App\SpUserPage', 'sp_user_frames', 'sp_user_page_id', 'sp_frame_id'); - } - - public function page() - { - return $this->belongsTo('App\SpPage', 'sp_page_id'); - } - - public function orginalTitleImage() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function title_image() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function files() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function frame_type() - { - return $this->belongsTo('App\SpFrameType', 'sp_frame_type_id'); - } - - public function getThumbnailAttribute() - { - if ($this->title_image->isNotEmpty()) { - return $this->title_image[0]->path; - } - return 'WM-Main/Assets/NoPreview/preview.png'; - } - - public function getTypeAttribute() - { - return $this->frame_type->type; - } - - public function scopeSection($query, $frameTypeId, $masterPageId) - { - return $query->where('sp_page_id', $masterPageId)->where('sp_frame_type_id', $frameTypeId); - } - - public function getFrameInfoAttribute($value) - { - return json_decode($value, true); - } - - public function setFrameInfoAttribute($value) - { - $this->attributes['frame_info'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - public function users() - { - return $this->belongsToMany('App\User', 'sp_frame_user')->withPivot('action')->withTimestamps(); - } - - public function user_frames() - { - return $this->hasMany('App\\SpUserFrame', 'sp_frame_id'); - } - -} diff --git a/app/SpFrameType.php b/app/SpFrameType.php deleted file mode 100644 index bc47bc7..0000000 --- a/app/SpFrameType.php +++ /dev/null @@ -1,25 +0,0 @@ -belongsTo('App\\SpPageType', 'dependent_page_type_id'); - } - - public function getFrameInfoFormAttribute($value) - { - return json_decode($value, true); - } - - public function setFrameInfoFormAttribute($value) - { - $this->attributes['frame_info_form'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } -} diff --git a/app/SpLink.php b/app/SpLink.php deleted file mode 100644 index fa4fac9..0000000 --- a/app/SpLink.php +++ /dev/null @@ -1,22 +0,0 @@ -morphTo(); - } - - public function page() - { - return $this->belongsTo('App\\SpUserPage', 'page_id'); - } - -} diff --git a/app/SpMasterTemplate.php b/app/SpMasterTemplate.php deleted file mode 100644 index 25c5d8c..0000000 --- a/app/SpMasterTemplate.php +++ /dev/null @@ -1,18 +0,0 @@ -hasMany('App\\SpTemplate'); - } - -} diff --git a/app/SpPage.php b/app/SpPage.php deleted file mode 100644 index 1c3441d..0000000 --- a/app/SpPage.php +++ /dev/null @@ -1,26 +0,0 @@ -belongsTo('App\SpTemplate'); - } - - public function frames() - { - return $this->hasMany('App\SpFrame', 'sp_page_id'); - } - - public function user_pages() - { - return $this->hasMany('App\SpUserPage'); - } - -} diff --git a/app/SpPageType.php b/app/SpPageType.php deleted file mode 100644 index 4a6e352..0000000 --- a/app/SpPageType.php +++ /dev/null @@ -1,16 +0,0 @@ -belongsToMany('App\SpFrameType', 'page_type_has_frame_type', 'sp_page_type_id', 'sp_frame_type_id'); - } - -} diff --git a/app/SpSection.php b/app/SpSection.php deleted file mode 100644 index 6d1253f..0000000 --- a/app/SpSection.php +++ /dev/null @@ -1,31 +0,0 @@ -belongsTo('App\SpPage','sp_page_id','id'); - } - - public function allowed_frames() - { - return $this->hasMany('App\SpFrame','sp_section_id','id'); - } - - public function frames() - { - return $this->belongsToMany('App\SpFrame','sp_user_frames','sp_section_id','sp_frame_id'); - } - - public function user_frames() - { - return $this->hasMany('App\SpUserFrame','sp_section_id','id'); - } - -} diff --git a/app/SpTemplate.php b/app/SpTemplate.php deleted file mode 100644 index b040ef8..0000000 --- a/app/SpTemplate.php +++ /dev/null @@ -1,80 +0,0 @@ -hasMany('App\SpPage'); - } - - public function first_page() - { - return $this->hasOne('App\SpPage'); - } - - public function frames() - { - return $this->hasMany('App\SpFrame'); - } - - public function category() - { - return $this->belongsTo('App\Category'); - } - - public function user_templates() - { - return $this->hasMany('App\SpUserTemplate'); - } - - - public function facilities() - { - return $this->belongsToMany('App\SpFacility', 'facility_template', 'template_id', 'facility_id'); - } - - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function orginalTitleImage() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function title_image() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function files() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function master_template() - { - return $this->belongsTo('App\\SpMasterTemplate', 'sp_master_template_id'); - } - - public function getRtlAttribute($value) { - return json_decode($value, true); - } - - public function getLtrAttribute($value) { - return json_decode($value, true); - } -// public function files() -// { -// return $this->morphToMany('App\Gallery', 'uploadable'); -// } - -} diff --git a/app/SpUserElement.php b/app/SpUserElement.php deleted file mode 100644 index 2f83cf4..0000000 --- a/app/SpUserElement.php +++ /dev/null @@ -1,53 +0,0 @@ -belongsTo('App\BusinessItem', 'element_id')->where('element_type', '=', 'App\BusinessItem'); - } - - public function categories() - { - return $this->belongsTo('App\BusinessItem', 'element_id')->where('element_type', '=', 'App\Category'); - } - - public function userFrame() { - return $this->belongsTo('App\SpUserFrame', 'sp_user_frame_id'); - } - - public function images() { - return $this->morphToMany('App\Gallery', 'uploadable')->withPivot('id', 'image_role'); - } - - public function links() - { - return $this->morphMany('App\SpLink', 'linkable'); - } - - public function getDataAttribute($value) - { - return json_decode($value, true); - } - - public function getLanguageIdAttribute() { - return $this->userFrame->language_id; - } - - public function setDataAttribute($value) - { - $this->attributes['data'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - -} diff --git a/app/SpUserFacility.php b/app/SpUserFacility.php deleted file mode 100644 index cf6eff8..0000000 --- a/app/SpUserFacility.php +++ /dev/null @@ -1,21 +0,0 @@ -belongsTo('App\\SpFacility'); - } - - public function user_template() - { - return $this->belongsTo('App\\SpUserTemplate'); - } - -} diff --git a/app/SpUserFrame.php b/app/SpUserFrame.php deleted file mode 100644 index 23cdae0..0000000 --- a/app/SpUserFrame.php +++ /dev/null @@ -1,134 +0,0 @@ -belongsTo('App\\Business'); - } - - public function frame() - { - return $this->belongsTo('App\\SpFrame','sp_frame_id'); - } - - public function parent() - { - return $this->belongsTo('App\\SpUserFrame', 'parent_id'); - } - public function children() - { - return $this->hasMany('App\\SpUserFrame', 'parent_id'); - } - - public function user_pages() - { - return $this->belongsToMany('App\SpUserPage', 'user_page_frame')->withPivot('frame_order'); - } - - public function business_items() - { - return $this->morphedByMany('App\\BusinessItem', 'element', 'sp_user_elements'); - } - public function news() - { - return $this->morphedByMany('App\\News', 'element', 'sp_user_elements'); - } - public function categories() - { - return $this->morphedByMany('App\\Category', 'element', 'sp_user_elements'); - } - public function posts() - { - return $this->morphedByMany('App\\Post', 'element', 'sp_user_elements'); - } - - public function products() - { - return $this->morphedByMany('App\\Product', 'element', 'sp_user_elements'); - } - - public function elements() - { - return $this->hasMany('App\\SpUserElement', 'sp_user_frame_id')->orderBy('element_order'); - } - - public function links() - { - return $this->morphMany('App\SpLink', 'linkable'); - } - - public function images() - { - return $this->morphToMany('App\Gallery','uploadable')->withPivot('image_role'); - } - - public function scopeSection($query, $frameTypeId, $userTemplateId, $masterPageId, $languageId) - { - return $query->where('language_id', $languageId)->where('sp_user_template_id', $userTemplateId) - ->whereHas('frame', function ($q1) use ($frameTypeId, $masterPageId) { - $q1->where('sp_page_id', $masterPageId)->where('sp_frame_type_id', $frameTypeId); - }); - } - - public function language() - { - return $this->belongsTo('App\\Language', 'language_id'); - } - - /******************************************************* - accessors and mutators - *******************************************************/ - - public function getDataAttribute($value) - { - return json_decode($value, true); - } - - public function setDataAttribute($value) - { - $this->attributes['data'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - public function getFrameOrderAttribute() - { - return $this->pivot->frame_order; - } - - public function getThumbnailAttribute() - { - if ($this->frame->title_image->isNotEmpty()) { - return $this->frame->title_image[0]->path; - } - return 'WM-Main/Assets/NoPreview/preview.png'; - } - - public function getTypeAttribute() - { - return $this->frame->frame_type->type; - } - - public function getNameEnAttribute() - { - return $this->frame->name_en; - } - - public function getNameFaAttribute() - { - return $this->frame->name_fa; - } -} diff --git a/app/SpUserPage.php b/app/SpUserPage.php deleted file mode 100644 index 00e4db2..0000000 --- a/app/SpUserPage.php +++ /dev/null @@ -1,90 +0,0 @@ -belongsTo('App\SpUserTemplate','sp_user_template_id'); - - } - - - - public function page() - - { - - return $this->belongsTo('App\SpPage', 'sp_page_id'); - - } - - - public function frames() - { - return $this->belongsToMany('App\SpFrame','sp_user_frames'); - } - - - - public function user_frames() - - { - - return $this->belongsToMany('App\SpUserFrame', 'user_page_frame')->withPivot('frame_order'); - - } - - - - public function business() - - { - - return $this->belongsTo('App\Business'); - - } - - public function page_type() - { - - return $this->belongsTo('App\SpPageType', 'sp_page_type_id'); - - } - - public function language() - { - - return $this->belongsTo('App\Language', 'language_id'); - - } - - public function scopePageType($query, $templateId, $languageId, $pageResponsibility, $pageType = '') - { - - return $query->select('id', 'name_en', 'name_fa', 'sp_page_type_id', 'description') - ->where('sp_user_template_id', $templateId) - ->where('language_id', $languageId) - ->whereHas('page_type', function($q) use ($pageType, $pageResponsibility) { - $q->where('responsibility', $pageResponsibility)->where('type', $pageType); - }); - - } - -} diff --git a/app/SpUserTemplate.php b/app/SpUserTemplate.php deleted file mode 100644 index 9b8005f..0000000 --- a/app/SpUserTemplate.php +++ /dev/null @@ -1,78 +0,0 @@ -belongsTo('App\SpUserTemplate', 'parent_id'); - } - public function children() - { - return $this->hasMany('App\SpUserTemplate', 'parent_id'); - } - - public function template() - { - return $this->belongsTo('App\SpTemplate', 'sp_template_id'); - } - - public function pages() - { - return $this->belongsToMany('App\SpPage','sp_user_pages'); - } - - public function user_pages() - { - return $this->hasMany('App\SpUserPage'); - } - - public function home_page() - { - return $this->hasOne('App\SpUserPage')->where('name_en', 'Home'); - } - - public function business() - { - return $this->belongsTo('WM\\Core\\Models\\VirtualActivity'); - } - - public function user_facilities() - { - return $this->hasMany('App\SpUserFacility'); - } - - public function facilities() - { - return $this->belongsToMany('App\\SpFacility', 'sp_user_facilities', 'sp_user_template_id', 'sp_facility_id'); - } - - - public function images() { - return $this->morphToMany( 'App\Gallery', 'uploadable' ); - } - - public function title_image() { - return $this->morphToMany( 'App\Gallery', 'uploadable' )->wherePivot( 'image_role', 'TitleImage' )->where('parent_id', null);; - } - - public function gallery() { - return $this->morphToMany( 'App\Gallery', 'uploadable' )->wherePivot( 'image_role', 'Gallery' )->where('parent_id', null);; - } - public function language() - { - return $this->belongsTo('App\Language', 'default_language_id'); - } - public function sites() - { - return $this->hasMany('App\Site'); - } - -} diff --git a/app/SpecialContent.php b/app/SpecialContent.php deleted file mode 100644 index d901769..0000000 --- a/app/SpecialContent.php +++ /dev/null @@ -1,20 +0,0 @@ -hasMany('App\SpecialContentOption', 'special_content_id'); - } - - public function category() - { - return $this->belongsTo('App\Category'); - } -} diff --git a/app/SpecialContentOption.php b/app/SpecialContentOption.php deleted file mode 100644 index 1ac9e96..0000000 --- a/app/SpecialContentOption.php +++ /dev/null @@ -1,56 +0,0 @@ -belongsTo('App\SpecialContent'); - } - // public function getDetailsAttribute() - // { - // return json_decode($this->attributes['details']); - // } - // public function setDetailsAttribute($value) - // { - // $this->attributes['details'] = json_encode($value, JSON_UNESCAPED_UNICODE); - // } - - public function optionable() - { - return $this->morphTo(); - } - - public function files() - { - return $this->morphMany('App\Upload', 'uploadable')->select('id', 'uploadable_id', 'uploadable_type', 'user_id', 'path'); - } - - public function gallery() - { - return $this->morphMany('App\Upload', 'uploadable')->wherePivot('image_role', 'Gallery')->where('parent_id', null); - } - - public function orginalTitleImage() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function title_image() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'TitleImage')->where('parent_id', null); - } - - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - -} diff --git a/app/Staff.php b/app/Staff.php deleted file mode 100644 index caf14ed..0000000 --- a/app/Staff.php +++ /dev/null @@ -1,19 +0,0 @@ -hasMany('App\RollCall'); - } - -} diff --git a/app/Strategy.php b/app/Strategy.php deleted file mode 100644 index 7c3d3c9..0000000 --- a/app/Strategy.php +++ /dev/null @@ -1,24 +0,0 @@ -belongsTo('App\Category'); - } - - public function user() - { - return $this->belongsTo('App\User'); - } - -} diff --git a/app/Tag.php b/app/Tag.php deleted file mode 100644 index ee9b01f..0000000 --- a/app/Tag.php +++ /dev/null @@ -1,47 +0,0 @@ -morphedByMany('App\Business', 'taggable'); - } - - public function business_items() - { - return $this->morphedByMany('App\BusinessItem', 'taggable'); - } - - public function products() - { - return $this->morphedByMany('App\Product', 'taggable'); - } - - public function news() - { - return $this->morphedByMany('App\News', 'taggable'); - } - - public function events() - { - return $this->morphedByMany('App\Event', 'taggable'); - } - - public function toSearchableArray() - { - return [ - 'id' => $this->id, - 'name' => $this->name, - ]; - } -} diff --git a/app/TagGroup.php b/app/TagGroup.php deleted file mode 100644 index 63e780e..0000000 --- a/app/TagGroup.php +++ /dev/null @@ -1,23 +0,0 @@ -taggingUtility->tagModelString(); - return $this->hasMany($model, 'tag_group_id'); - } - -} diff --git a/app/Task.php b/app/Task.php deleted file mode 100644 index f8feaa5..0000000 --- a/app/Task.php +++ /dev/null @@ -1,78 +0,0 @@ -attributes['activity'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - public function setDateAttribute($value) - { - $carbon = new Carbon(); - $this->attributes['date'] = $carbon->timestamp($value)->timezone('Asia/Tehran')->toDateTimeString(); - } - - - public function finances() - { - return $this->morphMany('App\Finance', 'financable'); - } - - public function uploadables() - { - return $this->morphMany('App\Uploadable', 'uploadable'); - } - - public function gallery() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'Gallery')->where('parent_id', null);; - } - - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function logo() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'logo')->where('parent_id', null);; - } - - public function business() - { - return $this->belongsTo('App\Business'); - } - - public function user() - { - return $this->belongsTo('App\User'); - } - - public function owner() - { - return $this->belongsTo('App\User', 'owned_id'); - } - - public function comments() - { - return $this->morphMany('App\Comment', 'commentable')->orderBy('updated_at', 'desc'); - } - - public function taskable() - { - return $this->morphTo(); - } -} diff --git a/app/TempBusiness.php b/app/TempBusiness.php deleted file mode 100644 index e03448e..0000000 --- a/app/TempBusiness.php +++ /dev/null @@ -1,76 +0,0 @@ -attributes['details']); - } - - public function getPhonesAttribute() - { - return json_decode($this->attributes['phones']); - } - - public function addresses() - { - return $this->morphMany('App\Address', 'addressable'); - } - - public function comments() - { - return $this->morphMany('App\Comment', 'commentable')->orderBy('updated_at', 'desc'); - } - - public function categories() - { - return $this->belongsToMany('App\Category'); - } - - public function uploadables() - { - return $this->morphMany('App\Uploadable', 'uploadable'); - } - - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function logo() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'logo')->where('parent_id', null);; - } - - public function business() - { - return $this->belongsTo('App\Business'); - } - - public function tasks() - { - return $this->morphMany('App\Task', 'taskable'); - } - - public function user() - { - return $this->belongsTo('App\User'); - } - - public function marketer() - { - return $this->belongsTo('App\User','marketer_id'); - } -} diff --git a/app/Transaction.php b/app/Transaction.php deleted file mode 100644 index 6dce3a7..0000000 --- a/app/Transaction.php +++ /dev/null @@ -1,32 +0,0 @@ -hasMany('App\Order', 'transaction_id'); - } - - public function order() - { - return $this->hasOne('App\Order', 'transaction_id'); - } - - public function user_transaction() - { - return $this->hasMany('App\UserTransaction', 'transaction_id'); - } - - public function transaction_logs() - { - return $this->hasMany('App\TransactionLog'); - } - -} diff --git a/app/TransactionLog.php b/app/TransactionLog.php deleted file mode 100644 index db94ec8..0000000 --- a/app/TransactionLog.php +++ /dev/null @@ -1,18 +0,0 @@ -belongsTo('App\Transaction'); - } - -} diff --git a/app/Upload.php b/app/Upload.php deleted file mode 100644 index 4340e9a..0000000 --- a/app/Upload.php +++ /dev/null @@ -1,24 +0,0 @@ -morphTo(); - } - - public function creator () - { - return $this->belongsTo('App\User'); - } - -} diff --git a/app/Uploadable.php b/app/Uploadable.php deleted file mode 100644 index d12b69c..0000000 --- a/app/Uploadable.php +++ /dev/null @@ -1,26 +0,0 @@ -belongsTo('App\Gallery')->where('parent_id' , null); - } - public function ThumbGallery() - { - return $this->belongsTo('App\Gallery')->where('parent_id' , '!=' , null); - } - public function gallery() - { - return $this->belongsTo('App\Gallery'); - } - -} diff --git a/app/UploadableLast.php b/app/UploadableLast.php deleted file mode 100644 index 91c8dcc..0000000 --- a/app/UploadableLast.php +++ /dev/null @@ -1,26 +0,0 @@ -belongsTo('App\GalleryLast')->where('parent_id' , null); - } - public function ThumbGallery() - { - return $this->belongsTo('App\GalleryLast')->where('parent_id' , '!=' , null); - } - public function gallery() - { - return $this->belongsTo('App\GalleryLast'); - } - -} diff --git a/app/UploadableNew.php b/app/UploadableNew.php deleted file mode 100644 index e207d57..0000000 --- a/app/UploadableNew.php +++ /dev/null @@ -1,26 +0,0 @@ -belongsTo('App\GalleryNew')->where('parent_id' , null); - } - public function ThumbGallery() - { - return $this->belongsTo('App\GalleryNew')->where('parent_id' , '!=' , null); - } - public function gallery() - { - return $this->belongsTo('App\GalleryNew'); - } - -} diff --git a/app/User.php b/app/User.php deleted file mode 100644 index 65f21a0..0000000 --- a/app/User.php +++ /dev/null @@ -1,210 +0,0 @@ -primaryKey; - // - // return Cache::remember($cacheKey, 10, function () { - // return $this->roles()->get(); - // }*/ - // return $this->roles()->get(); - // - // } - // - public function canDo($permission, $requireAll = false) - { - if (is_array($permission)) { - foreach ($permission as $permName) { - $hasPerm = $this->canDo($permName); - if ($hasPerm && !$requireAll) { - return true; - } elseif (!$hasPerm && $requireAll) { - return false; - } - } - - return $requireAll; - } else { - foreach ($this->cachedRoles() as $role) { - // Validate against the Permission table - foreach ($role->cachedPermissions() as $perm) { - if (strtolower($permission) == strtolower($perm->title)) { - return true; - } - } - } - } - return false; - } - // - // public function hasRole($name) - // { - // foreach ($this->roles()->get() as $role) - // { - // if (strtolower($role->title)===strtolower($name)) - // { - // return true; - // } - // } - // return false; - // } - -/////////////////////////////////////////////////////////////////// - - public function images() - { - return $this->morphToMany('App\Gallery', 'uploadable'); - } - - public function offers() - { - return $this->hasMany('App\Offer'); - } - - public function shopping_carts() - { - return $this->hasMany('App\ShoppingCart'); - } - - public function businesses() - { - return $this->hasMany('App\Business'); - } - - public function business_items() - { - return $this->hasMany('App\BusinessItem'); - } - - public function feedbacks() - { - return $this->hasMany('App\Feedback'); - } - - - public function active_business() - { - return $this->belongsTo('App\Business', 'last_used_business'); - } - - public function buys() - { - return $this->hasMany('App\Order', 'buyer_id'); - } - - public function sells() - { - return $this->hasMany('App\Order', 'seller_id'); - } - - public function files() - { - return $this->hasMany('App\Gallery')->where('business_id', null); - } - - public function orginalProfile() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'Profile')->where('parent_id', null); - } - - public function Profile() - { - return $this->morphToMany('App\Gallery', 'uploadable')->wherePivot('image_role', 'Profile')->where('parent_id', null); - } - - public function addresses() - { - return $this->morphMany('App\Address', 'addressable'); - } - - public function introducer() - { - return $this->belongsTo('App\User', 'introducer_id', 'id'); - } - - public function send_conversations() - { - return $this->hasMany('App\Conversation', 'sender_id'); - } - - public function recieve_conversations() - { - return $this->hasMany('App\Conversation', 'receiver_id'); - } - - public function reservations() - { - return $this->hasMany('App\Reservation'); - } - - public function likes() - { - return $this->hasMany('App\Like'); - } -// public function files() -// { -// return $this->hasMany() -// } - public static function MakeDetail(){ - return json_encode (['NationalCode' , 'ParentName' , 'Educational' , 'PlaceBirth']); - } - public function setBirthdayAttribute($value) - { - $carbon = new Carbon(); - $date = substr($value, 0, -3); - $date = $carbon->timestamp($date)->timezone('Asia/Tehran')->toDateString(); - $this->attributes['birthday'] = $date; - } - - public function frames() - { - return $this->belongsToMany('App\\SpFrame', 'sp_frame_user')->withPivot('action')->withTimestamps(); - } -} diff --git a/app/UserTransaction.php b/app/UserTransaction.php deleted file mode 100644 index 1078940..0000000 --- a/app/UserTransaction.php +++ /dev/null @@ -1,19 +0,0 @@ -belongsTo('App\Transaction','transaction_id','id'); - } - - public function order() - { -// return $this - } -} \ No newline at end of file diff --git a/app/WmItem.php b/app/WmItem.php deleted file mode 100644 index 1c281a4..0000000 --- a/app/WmItem.php +++ /dev/null @@ -1,40 +0,0 @@ -morphMany('App\ShoppingCart', 'payable'); - } - - public function WmItemsCategory() - { - return $this->belongsTo('App\WmItemsCategory'); - } - - public function getDetailsAttribute($value) - { - return json_decode($value); - } - - public function setDetailsAttribute($value) - { - $this->attributes['details'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - - public function getPivotDetailsAttribute() - { - return json_decode($this->pivot->details); - } - - public function business() - { - return $this->belongsTo('App\Business'); - } - -} diff --git a/app/WmItemsCategory.php b/app/WmItemsCategory.php deleted file mode 100644 index e8a7aa8..0000000 --- a/app/WmItemsCategory.php +++ /dev/null @@ -1,25 +0,0 @@ -hasMany('App\WmItem'); - } - - public function getDetailsAttribute($value) - { - return json_decode($value); - } - - public function setDetailsAttribute($value) - { - $this->attributes['details'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - -} diff --git a/app/WmPackage.php b/app/WmPackage.php deleted file mode 100644 index 16e10bd..0000000 --- a/app/WmPackage.php +++ /dev/null @@ -1,24 +0,0 @@ -belongsToMany('App\WmItem')->withPivot('quantity','details'); - } - - public function getDetailsAttribute() - { - return json_decode($this->attributes['details']); - } - - public function setDetailsAttribute($value) - { - $this->attributes['details'] = json_encode($value, JSON_UNESCAPED_UNICODE); - } - -} diff --git a/composer.json b/composer.json index 53224d4..3c59624 100755 --- a/composer.json +++ b/composer.json @@ -14,6 +14,7 @@ "laravel/passport": "^7.3", "laravel/tinker": "^1.0", "wm/common": "dev-master", + "wm/core": "dev-master", "wm/crm": "dev-master", "wm/reservation": "dev-master" }, diff --git a/composer.lock b/composer.lock index 2314880..acd9a80 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "bf04db5e846207e0d63b65a4f6f13d0c", + "content-hash": "749057a96bf87d2a7b15a2b9aa64e371", "packages": [ { "name": "defuse/php-encryption", @@ -391,25 +391,25 @@ }, { "name": "fideloper/proxy", - "version": "4.2.0", + "version": "4.2.1", "source": { "type": "git", "url": "https://github.com/fideloper/TrustedProxy.git", - "reference": "39a4c2165e578bc771f5dc031c273210a3a9b6d2" + "reference": "03085e58ec7bee24773fa5a8850751a6e61a7e8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fideloper/TrustedProxy/zipball/39a4c2165e578bc771f5dc031c273210a3a9b6d2", - "reference": "39a4c2165e578bc771f5dc031c273210a3a9b6d2", + "url": "https://api.github.com/repos/fideloper/TrustedProxy/zipball/03085e58ec7bee24773fa5a8850751a6e61a7e8a", + "reference": "03085e58ec7bee24773fa5a8850751a6e61a7e8a", "shasum": "" }, "require": { - "illuminate/contracts": "~5.0|~6.0", + "illuminate/contracts": "^5.0|^6.0|^7.0", "php": ">=5.4.0" }, "require-dev": { - "illuminate/http": "~5.6|~6.0", - "mockery/mockery": "~1.0", + "illuminate/http": "^5.0|^6.0|^7.0", + "mockery/mockery": "^1.0", "phpunit/phpunit": "^6.0" }, "type": "library", @@ -441,7 +441,7 @@ "proxy", "trusted proxy" ], - "time": "2019-07-29T16:49:45+00:00" + "time": "2019-09-03T16:45:42+00:00" }, { "name": "firebase/php-jwt", @@ -825,16 +825,16 @@ }, { "name": "laravel/framework", - "version": "v5.8.33", + "version": "v5.8.35", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "58b81842cbdcfbbd8302790ac0f98119ea1c56e5" + "reference": "5a9e4d241a8b815e16c9d2151e908992c38db197" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/58b81842cbdcfbbd8302790ac0f98119ea1c56e5", - "reference": "58b81842cbdcfbbd8302790ac0f98119ea1c56e5", + "url": "https://api.github.com/repos/laravel/framework/zipball/5a9e4d241a8b815e16c9d2151e908992c38db197", + "reference": "5a9e4d241a8b815e16c9d2151e908992c38db197", "shasum": "" }, "require": { @@ -917,6 +917,7 @@ "suggest": { "aws/aws-sdk-php": "Required to use the SQS queue driver and SES mail driver (^3.0).", "doctrine/dbal": "Required to rename columns and drop SQLite columns (^2.6).", + "ext-gd": "Required to use Illuminate\\Http\\Testing\\FileFactory::image().", "ext-pcntl": "Required to use all features of the queue worker.", "ext-posix": "Required to use all features of the queue worker.", "filp/whoops": "Required for friendly error pages in development (^2.1.4).", @@ -968,7 +969,7 @@ "framework", "laravel" ], - "time": "2019-08-20T15:45:17+00:00" + "time": "2019-09-03T16:44:30+00:00" }, { "name": "laravel/passport", @@ -1211,16 +1212,16 @@ }, { "name": "league/flysystem", - "version": "1.0.54", + "version": "1.0.55", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "c681ed22508947a941f113d6cf51bdcf4b84faf9" + "reference": "33c91155537c6dc899eacdc54a13ac6303f156e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/c681ed22508947a941f113d6cf51bdcf4b84faf9", - "reference": "c681ed22508947a941f113d6cf51bdcf4b84faf9", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/33c91155537c6dc899eacdc54a13ac6303f156e6", + "reference": "33c91155537c6dc899eacdc54a13ac6303f156e6", "shasum": "" }, "require": { @@ -1291,7 +1292,7 @@ "sftp", "storage" ], - "time": "2019-08-23T21:50:05+00:00" + "time": "2019-08-24T11:17:19+00:00" }, { "name": "league/oauth2-server", @@ -1372,16 +1373,16 @@ }, { "name": "monolog/monolog", - "version": "1.24.0", + "version": "1.25.1", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266" + "reference": "70e65a5470a42cfec1a7da00d30edb6e617e8dcf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", - "reference": "bfc9ebb28f97e7a24c45bdc3f0ff482e47bb0266", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/70e65a5470a42cfec1a7da00d30edb6e617e8dcf", + "reference": "70e65a5470a42cfec1a7da00d30edb6e617e8dcf", "shasum": "" }, "require": { @@ -1446,20 +1447,20 @@ "logging", "psr-3" ], - "time": "2018-11-05T09:00:11+00:00" + "time": "2019-09-06T13:49:17+00:00" }, { "name": "nesbot/carbon", - "version": "2.23.1", + "version": "2.24.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "767617a047e5b8b8b3b0b6023a2650847ed7df02" + "reference": "934459c5ac0658bc765ad1e53512c7c77adcac29" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/767617a047e5b8b8b3b0b6023a2650847ed7df02", - "reference": "767617a047e5b8b8b3b0b6023a2650847ed7df02", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/934459c5ac0658bc765ad1e53512c7c77adcac29", + "reference": "934459c5ac0658bc765ad1e53512c7c77adcac29", "shasum": "" }, "require": { @@ -1513,20 +1514,20 @@ "datetime", "time" ], - "time": "2019-08-17T13:57:34+00:00" + "time": "2019-08-31T16:37:55+00:00" }, { "name": "nikic/php-parser", - "version": "v4.2.3", + "version": "v4.2.4", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "e612609022e935f3d0337c1295176505b41188c8" + "reference": "97e59c7a16464196a8b9c77c47df68e4a39a45c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/e612609022e935f3d0337c1295176505b41188c8", - "reference": "e612609022e935f3d0337c1295176505b41188c8", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/97e59c7a16464196a8b9c77c47df68e4a39a45c4", + "reference": "97e59c7a16464196a8b9c77c47df68e4a39a45c4", "shasum": "" }, "require": { @@ -1564,20 +1565,20 @@ "parser", "php" ], - "time": "2019-08-12T20:17:41+00:00" + "time": "2019-09-01T07:51:21+00:00" }, { "name": "opis/closure", - "version": "3.3.1", + "version": "3.4.0", "source": { "type": "git", "url": "https://github.com/opis/closure.git", - "reference": "92927e26d7fc3f271efe1f55bdbb073fbb2f0722" + "reference": "60a97fff133b1669a5b1776aa8ab06db3f3962b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opis/closure/zipball/92927e26d7fc3f271efe1f55bdbb073fbb2f0722", - "reference": "92927e26d7fc3f271efe1f55bdbb073fbb2f0722", + "url": "https://api.github.com/repos/opis/closure/zipball/60a97fff133b1669a5b1776aa8ab06db3f3962b7", + "reference": "60a97fff133b1669a5b1776aa8ab06db3f3962b7", "shasum": "" }, "require": { @@ -1625,7 +1626,7 @@ "serialization", "serialize" ], - "time": "2019-07-09T21:58:11+00:00" + "time": "2019-09-02T21:07:33+00:00" }, { "name": "paragonie/random_compat", @@ -2320,16 +2321,16 @@ }, { "name": "symfony/console", - "version": "v4.3.3", + "version": "v4.3.4", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "8b0ae5742ce9aaa8b0075665862c1ca397d1c1d9" + "reference": "de63799239b3881b8a08f8481b22348f77ed7b36" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/8b0ae5742ce9aaa8b0075665862c1ca397d1c1d9", - "reference": "8b0ae5742ce9aaa8b0075665862c1ca397d1c1d9", + "url": "https://api.github.com/repos/symfony/console/zipball/de63799239b3881b8a08f8481b22348f77ed7b36", + "reference": "de63799239b3881b8a08f8481b22348f77ed7b36", "shasum": "" }, "require": { @@ -2391,20 +2392,20 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2019-07-24T17:13:59+00:00" + "time": "2019-08-26T08:26:39+00:00" }, { "name": "symfony/css-selector", - "version": "v4.3.3", + "version": "v4.3.4", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "105c98bb0c5d8635bea056135304bd8edcc42b4d" + "reference": "c6e5e2a00db768c92c3ae131532af4e1acc7bd03" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/105c98bb0c5d8635bea056135304bd8edcc42b4d", - "reference": "105c98bb0c5d8635bea056135304bd8edcc42b4d", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/c6e5e2a00db768c92c3ae131532af4e1acc7bd03", + "reference": "c6e5e2a00db768c92c3ae131532af4e1acc7bd03", "shasum": "" }, "require": { @@ -2444,20 +2445,20 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2019-01-16T21:53:39+00:00" + "time": "2019-08-20T14:07:54+00:00" }, { "name": "symfony/debug", - "version": "v4.3.3", + "version": "v4.3.4", "source": { "type": "git", "url": "https://github.com/symfony/debug.git", - "reference": "527887c3858a2462b0137662c74837288b998ee3" + "reference": "afcdea44a2e399c1e4b52246ec8d54c715393ced" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/debug/zipball/527887c3858a2462b0137662c74837288b998ee3", - "reference": "527887c3858a2462b0137662c74837288b998ee3", + "url": "https://api.github.com/repos/symfony/debug/zipball/afcdea44a2e399c1e4b52246ec8d54c715393ced", + "reference": "afcdea44a2e399c1e4b52246ec8d54c715393ced", "shasum": "" }, "require": { @@ -2500,20 +2501,20 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2019-07-23T11:21:36+00:00" + "time": "2019-08-20T14:27:59+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.3.3", + "version": "v4.3.4", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "212b020949331b6531250584531363844b34a94e" + "reference": "429d0a1451d4c9c4abe1959b2986b88794b9b7d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/212b020949331b6531250584531363844b34a94e", - "reference": "212b020949331b6531250584531363844b34a94e", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/429d0a1451d4c9c4abe1959b2986b88794b9b7d2", + "reference": "429d0a1451d4c9c4abe1959b2986b88794b9b7d2", "shasum": "" }, "require": { @@ -2570,7 +2571,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2019-06-27T06:42:14+00:00" + "time": "2019-08-26T08:55:16+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -2632,16 +2633,16 @@ }, { "name": "symfony/finder", - "version": "v4.3.3", + "version": "v4.3.4", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "9638d41e3729459860bb96f6247ccb61faaa45f2" + "reference": "86c1c929f0a4b24812e1eb109262fc3372c8e9f2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/9638d41e3729459860bb96f6247ccb61faaa45f2", - "reference": "9638d41e3729459860bb96f6247ccb61faaa45f2", + "url": "https://api.github.com/repos/symfony/finder/zipball/86c1c929f0a4b24812e1eb109262fc3372c8e9f2", + "reference": "86c1c929f0a4b24812e1eb109262fc3372c8e9f2", "shasum": "" }, "require": { @@ -2677,20 +2678,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2019-06-28T13:16:30+00:00" + "time": "2019-08-14T12:26:46+00:00" }, { "name": "symfony/http-foundation", - "version": "v4.3.3", + "version": "v4.3.4", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "8b778ee0c27731105fbf1535f51793ad1ae0ba2b" + "reference": "d804bea118ff340a12e22a79f9c7e7eb56b35adc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/8b778ee0c27731105fbf1535f51793ad1ae0ba2b", - "reference": "8b778ee0c27731105fbf1535f51793ad1ae0ba2b", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/d804bea118ff340a12e22a79f9c7e7eb56b35adc", + "reference": "d804bea118ff340a12e22a79f9c7e7eb56b35adc", "shasum": "" }, "require": { @@ -2732,20 +2733,20 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2019-07-23T11:21:36+00:00" + "time": "2019-08-26T08:55:16+00:00" }, { "name": "symfony/http-kernel", - "version": "v4.3.3", + "version": "v4.3.4", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "a414548d236ddd8fa3df52367d583e82339c5e95" + "reference": "5e0fc71be03d52cd00c423061cfd300bd6f92a52" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/a414548d236ddd8fa3df52367d583e82339c5e95", - "reference": "a414548d236ddd8fa3df52367d583e82339c5e95", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/5e0fc71be03d52cd00c423061cfd300bd6f92a52", + "reference": "5e0fc71be03d52cd00c423061cfd300bd6f92a52", "shasum": "" }, "require": { @@ -2824,20 +2825,20 @@ ], "description": "Symfony HttpKernel Component", "homepage": "https://symfony.com", - "time": "2019-07-28T07:10:23+00:00" + "time": "2019-08-26T16:47:42+00:00" }, { "name": "symfony/mime", - "version": "v4.3.3", + "version": "v4.3.4", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "6b7148029b1dd5eda1502064f06d01357b7b2d8b" + "reference": "987a05df1c6ac259b34008b932551353f4f408df" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/6b7148029b1dd5eda1502064f06d01357b7b2d8b", - "reference": "6b7148029b1dd5eda1502064f06d01357b7b2d8b", + "url": "https://api.github.com/repos/symfony/mime/zipball/987a05df1c6ac259b34008b932551353f4f408df", + "reference": "987a05df1c6ac259b34008b932551353f4f408df", "shasum": "" }, "require": { @@ -2846,7 +2847,7 @@ "symfony/polyfill-mbstring": "^1.0" }, "require-dev": { - "egulias/email-validator": "^2.0", + "egulias/email-validator": "^2.1.10", "symfony/dependency-injection": "~3.4|^4.1" }, "type": "library", @@ -2883,7 +2884,7 @@ "mime", "mime-type" ], - "time": "2019-07-19T16:21:19+00:00" + "time": "2019-08-22T08:16:11+00:00" }, { "name": "symfony/polyfill-ctype", @@ -3238,16 +3239,16 @@ }, { "name": "symfony/process", - "version": "v4.3.3", + "version": "v4.3.4", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "856d35814cf287480465bb7a6c413bb7f5f5e69c" + "reference": "e89969c00d762349f078db1128506f7f3dcc0d4a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/856d35814cf287480465bb7a6c413bb7f5f5e69c", - "reference": "856d35814cf287480465bb7a6c413bb7f5f5e69c", + "url": "https://api.github.com/repos/symfony/process/zipball/e89969c00d762349f078db1128506f7f3dcc0d4a", + "reference": "e89969c00d762349f078db1128506f7f3dcc0d4a", "shasum": "" }, "require": { @@ -3283,7 +3284,7 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2019-05-30T16:10:05+00:00" + "time": "2019-08-26T08:26:39+00:00" }, { "name": "symfony/psr-http-message-bridge", @@ -3352,16 +3353,16 @@ }, { "name": "symfony/routing", - "version": "v4.3.3", + "version": "v4.3.4", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "a88c47a5861549f5dc1197660818084c3b67d773" + "reference": "ff1049f6232dc5b6023b1ff1c6de56f82bcd264f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/a88c47a5861549f5dc1197660818084c3b67d773", - "reference": "a88c47a5861549f5dc1197660818084c3b67d773", + "url": "https://api.github.com/repos/symfony/routing/zipball/ff1049f6232dc5b6023b1ff1c6de56f82bcd264f", + "reference": "ff1049f6232dc5b6023b1ff1c6de56f82bcd264f", "shasum": "" }, "require": { @@ -3424,20 +3425,20 @@ "uri", "url" ], - "time": "2019-07-23T14:43:56+00:00" + "time": "2019-08-26T08:26:39+00:00" }, { "name": "symfony/service-contracts", - "version": "v1.1.5", + "version": "v1.1.6", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "f391a00de78ec7ec8cf5cdcdae59ec7b883edb8d" + "reference": "ea7263d6b6d5f798b56a45a5b8d686725f2719a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/f391a00de78ec7ec8cf5cdcdae59ec7b883edb8d", - "reference": "f391a00de78ec7ec8cf5cdcdae59ec7b883edb8d", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/ea7263d6b6d5f798b56a45a5b8d686725f2719a3", + "reference": "ea7263d6b6d5f798b56a45a5b8d686725f2719a3", "shasum": "" }, "require": { @@ -3482,26 +3483,26 @@ "interoperability", "standards" ], - "time": "2019-06-13T11:15:36+00:00" + "time": "2019-08-20T14:44:19+00:00" }, { "name": "symfony/translation", - "version": "v4.3.3", + "version": "v4.3.4", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "4e3e39cc485304f807622bdc64938e4633396406" + "reference": "28498169dd334095fa981827992f3a24d50fed0f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/4e3e39cc485304f807622bdc64938e4633396406", - "reference": "4e3e39cc485304f807622bdc64938e4633396406", + "url": "https://api.github.com/repos/symfony/translation/zipball/28498169dd334095fa981827992f3a24d50fed0f", + "reference": "28498169dd334095fa981827992f3a24d50fed0f", "shasum": "" }, "require": { "php": "^7.1.3", "symfony/polyfill-mbstring": "~1.0", - "symfony/translation-contracts": "^1.1.2" + "symfony/translation-contracts": "^1.1.6" }, "conflict": { "symfony/config": "<3.4", @@ -3558,20 +3559,20 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2019-07-18T10:34:59+00:00" + "time": "2019-08-26T08:55:16+00:00" }, { "name": "symfony/translation-contracts", - "version": "v1.1.5", + "version": "v1.1.6", "source": { "type": "git", "url": "https://github.com/symfony/translation-contracts.git", - "reference": "cb4b18ad7b92a26e83b65dde940fab78339e6f3c" + "reference": "325b17c24f3ee23cbecfa63ba809c6d89b5fa04a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/cb4b18ad7b92a26e83b65dde940fab78339e6f3c", - "reference": "cb4b18ad7b92a26e83b65dde940fab78339e6f3c", + "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/325b17c24f3ee23cbecfa63ba809c6d89b5fa04a", + "reference": "325b17c24f3ee23cbecfa63ba809c6d89b5fa04a", "shasum": "" }, "require": { @@ -3615,20 +3616,20 @@ "interoperability", "standards" ], - "time": "2019-06-13T11:15:36+00:00" + "time": "2019-08-02T12:15:04+00:00" }, { "name": "symfony/var-dumper", - "version": "v4.3.3", + "version": "v4.3.4", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "e4110b992d2cbe198d7d3b244d079c1c58761d07" + "reference": "641043e0f3e615990a0f29479f9c117e8a6698c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/e4110b992d2cbe198d7d3b244d079c1c58761d07", - "reference": "e4110b992d2cbe198d7d3b244d079c1c58761d07", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/641043e0f3e615990a0f29479f9c117e8a6698c6", + "reference": "641043e0f3e615990a0f29479f9c117e8a6698c6", "shasum": "" }, "require": { @@ -3691,7 +3692,7 @@ "debug", "dump" ], - "time": "2019-07-27T06:42:46+00:00" + "time": "2019-08-26T08:26:39+00:00" }, { "name": "tijsverkoyen/css-to-inline-styles", @@ -3742,16 +3743,16 @@ }, { "name": "vlucas/phpdotenv", - "version": "v3.4.0", + "version": "v3.5.0", "source": { "type": "git", "url": "https://github.com/vlucas/phpdotenv.git", - "reference": "5084b23845c24dbff8ac6c204290c341e4776c92" + "reference": "95cb0fa6c025f7f0db7fc60f81e9fb231eb2d222" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/5084b23845c24dbff8ac6c204290c341e4776c92", - "reference": "5084b23845c24dbff8ac6c204290c341e4776c92", + "url": "https://api.github.com/repos/vlucas/phpdotenv/zipball/95cb0fa6c025f7f0db7fc60f81e9fb231eb2d222", + "reference": "95cb0fa6c025f7f0db7fc60f81e9fb231eb2d222", "shasum": "" }, "require": { @@ -3765,7 +3766,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.4-dev" + "dev-master": "3.5-dev" } }, "autoload": { @@ -3778,10 +3779,15 @@ "BSD-3-Clause" ], "authors": [ + { + "name": "Graham Campbell", + "email": "graham@alt-three.com", + "homepage": "https://gjcampbell.co.uk/" + }, { "name": "Vance Lucas", "email": "vance@vancelucas.com", - "homepage": "http://www.vancelucas.com" + "homepage": "https://vancelucas.com/" } ], "description": "Loads environment variables from `.env` to `getenv()`, `$_ENV` and `$_SERVER` automagically.", @@ -3790,7 +3796,7 @@ "env", "environment" ], - "time": "2019-06-15T22:40:20+00:00" + "time": "2019-08-27T17:00:38+00:00" }, { "name": "wm/common", @@ -3798,7 +3804,7 @@ "dist": { "type": "path", "url": "./modules/wm-common", - "reference": "6c182b87de234466a6950ac24cc9afaca524c570", + "reference": "02182c4005bfb0a1ddfe505b61b20cc40983ca0c", "shasum": null }, "require": { @@ -3821,7 +3827,11 @@ "autoload": { "psr-4": { "WM\\Common\\": "src/" - } + }, + "classmap": [ + "database/seeds", + "database/factories" + ] }, "autoload-dev": { "psr-4": { @@ -3839,7 +3849,7 @@ "dist": { "type": "path", "url": "./modules/wm-core", - "reference": "a9dcd537a7f3d2bb8b86e7c6a144bd0c4e8d10c9", + "reference": "7dde2817a09c7ee79527bde3eb2e64f833cf9535", "shasum": null }, "require": { @@ -3884,7 +3894,7 @@ "dist": { "type": "path", "url": "./modules/wm-crm", - "reference": "234a0d2b3ccb4aad7cb9d0c7981705c2e70ec2d0", + "reference": "997e15bf31c75652bd783eb13ebed07d3be7abea", "shasum": null }, "require": { @@ -3908,7 +3918,11 @@ "autoload": { "psr-4": { "WM\\CRM\\": "src/" - } + }, + "classmap": [ + "database/seeds", + "database/factories" + ] }, "autoload-dev": { "psr-4": { @@ -5796,6 +5810,7 @@ "minimum-stability": "dev", "stability-flags": { "wm/common": 20, + "wm/core": 20, "wm/crm": 20, "wm/reservation": 20 }, diff --git a/config/modules.php b/config/modules.php deleted file mode 100644 index 4432f45..0000000 --- a/config/modules.php +++ /dev/null @@ -1,188 +0,0 @@ - 'Modules', - - /* - |-------------------------------------------------------------------------- - | Module Stubs - |-------------------------------------------------------------------------- - | - | Default module stubs. - | - */ - - 'stubs' => [ - 'enabled' => false, - 'path' => base_path() . '/vendor/nwidart/laravel-modules/src/Commands/stubs', - 'files' => [ - 'routes/web' => 'Routes/web.php', - 'routes/api' => 'Routes/api.php', - 'views/index' => 'Resources/views/index.blade.php', - 'views/master' => 'Resources/views/layouts/master.blade.php', - 'scaffold/config' => 'Config/config.php', - 'composer' => 'composer.json', - 'assets/js/app' => 'Resources/assets/js/app.js', - 'assets/sass/app' => 'Resources/assets/sass/app.scss', - 'webpack' => 'webpack.mix.js', - 'package' => 'package.json', - ], - 'replacements' => [ - 'routes/web' => ['LOWER_NAME', 'STUDLY_NAME'], - 'routes/api' => ['LOWER_NAME'], - 'webpack' => ['LOWER_NAME'], - 'json' => ['LOWER_NAME', 'STUDLY_NAME', 'MODULE_NAMESPACE'], - 'views/index' => ['LOWER_NAME'], - 'views/master' => ['LOWER_NAME', 'STUDLY_NAME'], - 'scaffold/config' => ['STUDLY_NAME'], - 'composer' => [ - 'LOWER_NAME', - 'STUDLY_NAME', - 'VENDOR', - 'AUTHOR_NAME', - 'AUTHOR_EMAIL', - 'MODULE_NAMESPACE', - ], - ], - 'gitkeep' => true, - ], - 'paths' => [ - /* - |-------------------------------------------------------------------------- - | Modules path - |-------------------------------------------------------------------------- - | - | This path used for save the generated module. This path also will be added - | automatically to list of scanned folders. - | - */ - - 'modules' => base_path('Modules'), - /* - |-------------------------------------------------------------------------- - | Modules assets path - |-------------------------------------------------------------------------- - | - | Here you may update the modules assets path. - | - */ - - 'assets' => public_path('modules'), - /* - |-------------------------------------------------------------------------- - | The migrations path - |-------------------------------------------------------------------------- - | - | Where you run 'module:publish-migration' command, where do you publish the - | the migration files? - | - */ - - 'migration' => base_path('database/migrations'), - /* - |-------------------------------------------------------------------------- - | Generator path - |-------------------------------------------------------------------------- - | Customise the paths where the folders will be generated. - | Set the generate key to false to not generate that folder - */ - 'generator' => [ - 'config' => ['path' => 'Config', 'generate' => true], - 'command' => ['path' => 'Console', 'generate' => true], - 'migration' => ['path' => 'Database/Migrations', 'generate' => true], - 'seeder' => ['path' => 'Database/Seeders', 'generate' => true], - 'factory' => ['path' => 'Database/factories', 'generate' => true], - 'model' => ['path' => 'Entities', 'generate' => true], - 'controller' => ['path' => 'Http/Controllers', 'generate' => true], - 'filter' => ['path' => 'Http/Middleware', 'generate' => true], - 'request' => ['path' => 'Http/Requests', 'generate' => true], - 'provider' => ['path' => 'Providers', 'generate' => true], - 'assets' => ['path' => 'Resources/assets', 'generate' => true], - 'lang' => ['path' => 'Resources/lang', 'generate' => true], - 'views' => ['path' => 'Resources/views', 'generate' => true], - 'test' => ['path' => 'Tests', 'generate' => true], - 'repository' => ['path' => 'Repositories', 'generate' => false], - 'event' => ['path' => 'Events', 'generate' => false], - 'listener' => ['path' => 'Listeners', 'generate' => false], - 'policies' => ['path' => 'Policies', 'generate' => false], - 'rules' => ['path' => 'Rules', 'generate' => false], - 'jobs' => ['path' => 'Jobs', 'generate' => false], - 'emails' => ['path' => 'Emails', 'generate' => false], - 'notifications' => ['path' => 'Notifications', 'generate' => false], - 'resource' => ['path' => 'Transformers', 'generate' => false], - ], - ], - /* - |-------------------------------------------------------------------------- - | Scan Path - |-------------------------------------------------------------------------- - | - | Here you define which folder will be scanned. By default will scan vendor - | directory. This is useful if you host the package in packagist website. - | - */ - - 'scan' => [ - 'enabled' => false, - 'paths' => [ - base_path('vendor/*/*'), - ], - ], - /* - |-------------------------------------------------------------------------- - | Composer File Template - |-------------------------------------------------------------------------- - | - | Here is the config for composer.json file, generated by this package - | - */ - - 'composer' => [ - 'vendor' => 'nwidart', - 'author' => [ - 'name' => 'Nicolas Widart', - 'email' => 'n.widart@gmail.com', - ], - ], - /* - |-------------------------------------------------------------------------- - | Caching - |-------------------------------------------------------------------------- - | - | Here is the config for setting up caching feature. - | - */ - 'cache' => [ - 'enabled' => false, - 'key' => 'laravel-modules', - 'lifetime' => 60, - ], - /* - |-------------------------------------------------------------------------- - | Choose what laravel-modules will register as custom namespaces. - | Setting one to false will require you to register that part - | in your own Service Provider class. - |-------------------------------------------------------------------------- - */ - 'register' => [ - 'translations' => true, - /** - * load files on boot or register method - * - * Note: boot not compatible with asgardcms - * - * @example boot|register - */ - 'files' => 'register', - ], -]; diff --git a/database/migrations/2019_09_05_192945_add_load_in_home_column.php b/database/migrations/2019_09_05_192945_add_load_in_home_column.php new file mode 100644 index 0000000..ddc3b3c --- /dev/null +++ b/database/migrations/2019_09_05_192945_add_load_in_home_column.php @@ -0,0 +1,31 @@ +enum('load_in_home', ['yes', 'no'])->default('yes'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + + } +} diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php index 904d8e3..1e740b7 100644 --- a/database/seeds/DatabaseSeeder.php +++ b/database/seeds/DatabaseSeeder.php @@ -11,6 +11,7 @@ class DatabaseSeeder extends Seeder */ public function run() { - $this->call(ModuleSeeder::class); + // $this->call(ModuleSeeder::class); + $this->call(ElementTypeSeeder::class); } } diff --git a/routes/api.php b/routes/api.php index c641ca5..0f37e00 100644 --- a/routes/api.php +++ b/routes/api.php @@ -13,6 +13,3 @@ use Illuminate\Http\Request; | */ -Route::middleware('auth:api')->get('/user', function (Request $request) { - return $request->user(); -}); From 5679e9d2d2c0eba87f8101170175a90922084ba0 Mon Sep 17 00:00:00 2001 From: saeid_01 Date: Fri, 6 Sep 2019 19:50:46 +0430 Subject: [PATCH 2/3] Form loader --- public/mix-manifest.json | 10 +++--- .../FormLoader/Elements/wm-checkbox.vue | 22 ++++++++++++ .../FormLoader/Elements/wm-form.vue | 9 +++++ .../FormLoader/Elements/wm-input.vue | 22 ++++++++++++ .../FormLoader/Elements/wm-radioButton.vue | 23 +++++++++++++ .../FormLoader/Elements/wm-select.vue | 23 +++++++++++++ .../FormLoader/Elements/wm-switch.vue | 21 ++++++++++++ .../FormLoader/Elements/wm-textarea.vue | 22 ++++++++++++ .../components/FormLoader/FactoryPattern.vue | 26 ++++++++++++++ .../Global/components/FormLoader/Wrapper.vue | 34 +++++++++++++++++++ resources/js/Global/components/Tiles/Tile.vue | 1 - resources/js/Global/mixins/global.js | 9 +++-- resources/js/Home/views/Home.vue | 21 ++++++------ 13 files changed, 225 insertions(+), 18 deletions(-) create mode 100644 resources/js/Global/components/FormLoader/Elements/wm-checkbox.vue create mode 100644 resources/js/Global/components/FormLoader/Elements/wm-form.vue create mode 100644 resources/js/Global/components/FormLoader/Elements/wm-input.vue create mode 100644 resources/js/Global/components/FormLoader/Elements/wm-radioButton.vue create mode 100644 resources/js/Global/components/FormLoader/Elements/wm-select.vue create mode 100644 resources/js/Global/components/FormLoader/Elements/wm-switch.vue create mode 100644 resources/js/Global/components/FormLoader/Elements/wm-textarea.vue create mode 100644 resources/js/Global/components/FormLoader/FactoryPattern.vue create mode 100644 resources/js/Global/components/FormLoader/Wrapper.vue diff --git a/public/mix-manifest.json b/public/mix-manifest.json index e59dd88..d71799b 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,7 +1,7 @@ { - "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=c9ebdffec50d82145867", - "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=e2cd567ef427a1285194", - "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=21ca2c0fd50704c54125", - "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=ecddb140ee87bb6dfc7c", - "/js/vue/User/app.js": "/js/vue/User/app.js?id=ba20da8154c5c04c0dd6" + "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js", + "/js/vue/Home/app.js": "/js/vue/Home/app.js", + "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js", + "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js", + "/js/vue/User/app.js": "/js/vue/User/app.js" } diff --git a/resources/js/Global/components/FormLoader/Elements/wm-checkbox.vue b/resources/js/Global/components/FormLoader/Elements/wm-checkbox.vue new file mode 100644 index 0000000..a118308 --- /dev/null +++ b/resources/js/Global/components/FormLoader/Elements/wm-checkbox.vue @@ -0,0 +1,22 @@ + + \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/wm-form.vue b/resources/js/Global/components/FormLoader/Elements/wm-form.vue new file mode 100644 index 0000000..bc9a33f --- /dev/null +++ b/resources/js/Global/components/FormLoader/Elements/wm-form.vue @@ -0,0 +1,9 @@ + + \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/wm-input.vue b/resources/js/Global/components/FormLoader/Elements/wm-input.vue new file mode 100644 index 0000000..c779f47 --- /dev/null +++ b/resources/js/Global/components/FormLoader/Elements/wm-input.vue @@ -0,0 +1,22 @@ + + \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/wm-radioButton.vue b/resources/js/Global/components/FormLoader/Elements/wm-radioButton.vue new file mode 100644 index 0000000..0f48e4f --- /dev/null +++ b/resources/js/Global/components/FormLoader/Elements/wm-radioButton.vue @@ -0,0 +1,23 @@ + + \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/wm-select.vue b/resources/js/Global/components/FormLoader/Elements/wm-select.vue new file mode 100644 index 0000000..fa4ef07 --- /dev/null +++ b/resources/js/Global/components/FormLoader/Elements/wm-select.vue @@ -0,0 +1,23 @@ + + \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/wm-switch.vue b/resources/js/Global/components/FormLoader/Elements/wm-switch.vue new file mode 100644 index 0000000..39fa8e4 --- /dev/null +++ b/resources/js/Global/components/FormLoader/Elements/wm-switch.vue @@ -0,0 +1,21 @@ + + \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/wm-textarea.vue b/resources/js/Global/components/FormLoader/Elements/wm-textarea.vue new file mode 100644 index 0000000..2bd0a2c --- /dev/null +++ b/resources/js/Global/components/FormLoader/Elements/wm-textarea.vue @@ -0,0 +1,22 @@ + + \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/FactoryPattern.vue b/resources/js/Global/components/FormLoader/FactoryPattern.vue new file mode 100644 index 0000000..93108a2 --- /dev/null +++ b/resources/js/Global/components/FormLoader/FactoryPattern.vue @@ -0,0 +1,26 @@ + + \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Wrapper.vue b/resources/js/Global/components/FormLoader/Wrapper.vue new file mode 100644 index 0000000..e1ed0b5 --- /dev/null +++ b/resources/js/Global/components/FormLoader/Wrapper.vue @@ -0,0 +1,34 @@ + + \ No newline at end of file diff --git a/resources/js/Global/components/Tiles/Tile.vue b/resources/js/Global/components/Tiles/Tile.vue index 69babc2..cbe6a55 100644 --- a/resources/js/Global/components/Tiles/Tile.vue +++ b/resources/js/Global/components/Tiles/Tile.vue @@ -49,7 +49,6 @@ export default { } }, data: function () { - console.log( ( this.RouteType == 'Route' ) ? 'router-link' : 'a' ); return { TagType: ( this.RouteType == 'Route' ) ? 'router-link' : 'a', RouteAddress: ( this.RouteType == 'Route' ) ? this.Route : false, diff --git a/resources/js/Global/mixins/global.js b/resources/js/Global/mixins/global.js index 61ab213..867432e 100644 --- a/resources/js/Global/mixins/global.js +++ b/resources/js/Global/mixins/global.js @@ -2,6 +2,7 @@ import { mapActions } from "vuex"; import globalStore from "@Global/store"; import authStore from "@Core/store"; import permissionList from "@Global/utils/Permissions/list"; +import { UserService } from "@Global/services/storage.services"; const global = { methods: { $_getPath(subPath) { @@ -29,16 +30,20 @@ const global = { let currentModule = globalStore.state.common.current_module; let permissions = authStore.state.auth.permissions; let multiPermission = permission.split("|"); + let siteOwner = !!UserService.get().is_owner; for (const iterator of multiPermission) { - if (iterator == '') { + if (iterator == "") { return true; } permission = permissionList[iterator]; if ( + siteOwner || owner || (permission && permissions[currentModule] && - Object.values(permissions[currentModule]).includes(permission)) + Object.values(permissions[currentModule]).includes( + permission + )) ) { return true; } diff --git a/resources/js/Home/views/Home.vue b/resources/js/Home/views/Home.vue index b62d9ae..64eb068 100644 --- a/resources/js/Home/views/Home.vue +++ b/resources/js/Home/views/Home.vue @@ -11,7 +11,6 @@ :TileClass="module.title_class" :TitleEn="module.title_en" :TitleFa="module.title_fa" - :Desc="module.description" :GradientBegin="module.gradient_begin" :GradientEnd="module.gradient_end" :ImageURL="module.img_url" @@ -24,6 +23,7 @@ fas fa-plus + @@ -31,22 +31,23 @@ From b2ddcec1b6ce052a370506f73ff1e3fcc1a82321 Mon Sep 17 00:00:00 2001 From: saeid_01 Date: Sat, 7 Sep 2019 00:56:29 +0430 Subject: [PATCH 3/3] elements in form loader --- public/mix-manifest.json | 10 +++---- .../FormLoader/Elements/wm-date.vue | 0 .../FormLoader/Elements/wm-dropzone.vue | 0 .../FormLoader/Elements/wm-file.vue | 0 .../FormLoader/Elements/wm-form.vue | 21 +++++++++++-- .../FormLoader/Elements/wm-number_input.vue | 30 +++++++++++++++++++ .../FormLoader/Elements/wm-range.vue | 30 +++++++++++++++++++ .../{wm-input.vue => wm-text_input.vue} | 7 +++++ .../FormLoader/Elements/wm-time.vue | 0 .../components/FormLoader/FactoryPattern.vue | 2 +- .../Global/components/FormLoader/Wrapper.vue | 18 +++++------ resources/js/Home/views/Home.vue | 6 ++-- 12 files changed, 103 insertions(+), 21 deletions(-) create mode 100644 resources/js/Global/components/FormLoader/Elements/wm-date.vue create mode 100644 resources/js/Global/components/FormLoader/Elements/wm-dropzone.vue create mode 100644 resources/js/Global/components/FormLoader/Elements/wm-file.vue create mode 100644 resources/js/Global/components/FormLoader/Elements/wm-number_input.vue create mode 100644 resources/js/Global/components/FormLoader/Elements/wm-range.vue rename resources/js/Global/components/FormLoader/Elements/{wm-input.vue => wm-text_input.vue} (78%) create mode 100644 resources/js/Global/components/FormLoader/Elements/wm-time.vue diff --git a/public/mix-manifest.json b/public/mix-manifest.json index d71799b..cefc2cd 100644 --- a/public/mix-manifest.json +++ b/public/mix-manifest.json @@ -1,7 +1,7 @@ { - "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js", - "/js/vue/Home/app.js": "/js/vue/Home/app.js", - "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js", - "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js", - "/js/vue/User/app.js": "/js/vue/User/app.js" + "/js/vue/Authentication/app.js": "/js/vue/Authentication/app.js?id=1e82449eeed5825a8ba1", + "/js/vue/Home/app.js": "/js/vue/Home/app.js?id=8eaf21984d417aafd698", + "/js/vue/Modules/CRM/app.js": "/js/vue/Modules/CRM/app.js?id=f30c2bd0c5cc464db69b", + "/js/vue/Modules/Reservation/app.js": "/js/vue/Modules/Reservation/app.js?id=b993b2ea20cfffd23264", + "/js/vue/User/app.js": "/js/vue/User/app.js?id=ed8c59c266ebb9751214" } diff --git a/resources/js/Global/components/FormLoader/Elements/wm-date.vue b/resources/js/Global/components/FormLoader/Elements/wm-date.vue new file mode 100644 index 0000000..e69de29 diff --git a/resources/js/Global/components/FormLoader/Elements/wm-dropzone.vue b/resources/js/Global/components/FormLoader/Elements/wm-dropzone.vue new file mode 100644 index 0000000..e69de29 diff --git a/resources/js/Global/components/FormLoader/Elements/wm-file.vue b/resources/js/Global/components/FormLoader/Elements/wm-file.vue new file mode 100644 index 0000000..e69de29 diff --git a/resources/js/Global/components/FormLoader/Elements/wm-form.vue b/resources/js/Global/components/FormLoader/Elements/wm-form.vue index bc9a33f..400b202 100644 --- a/resources/js/Global/components/FormLoader/Elements/wm-form.vue +++ b/resources/js/Global/components/FormLoader/Elements/wm-form.vue @@ -1,9 +1,24 @@ \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/wm-number_input.vue b/resources/js/Global/components/FormLoader/Elements/wm-number_input.vue new file mode 100644 index 0000000..d56e5e7 --- /dev/null +++ b/resources/js/Global/components/FormLoader/Elements/wm-number_input.vue @@ -0,0 +1,30 @@ + + \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/wm-range.vue b/resources/js/Global/components/FormLoader/Elements/wm-range.vue new file mode 100644 index 0000000..236dc8c --- /dev/null +++ b/resources/js/Global/components/FormLoader/Elements/wm-range.vue @@ -0,0 +1,30 @@ + + \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/wm-input.vue b/resources/js/Global/components/FormLoader/Elements/wm-text_input.vue similarity index 78% rename from resources/js/Global/components/FormLoader/Elements/wm-input.vue rename to resources/js/Global/components/FormLoader/Elements/wm-text_input.vue index c779f47..7922436 100644 --- a/resources/js/Global/components/FormLoader/Elements/wm-input.vue +++ b/resources/js/Global/components/FormLoader/Elements/wm-text_input.vue @@ -17,6 +17,13 @@ export default { element:{ type: Object } + }, + watch:{ + element(){ + console.log(this.element); + + } } + } \ No newline at end of file diff --git a/resources/js/Global/components/FormLoader/Elements/wm-time.vue b/resources/js/Global/components/FormLoader/Elements/wm-time.vue new file mode 100644 index 0000000..e69de29 diff --git a/resources/js/Global/components/FormLoader/FactoryPattern.vue b/resources/js/Global/components/FormLoader/FactoryPattern.vue index 93108a2..1efd97c 100644 --- a/resources/js/Global/components/FormLoader/FactoryPattern.vue +++ b/resources/js/Global/components/FormLoader/FactoryPattern.vue @@ -1,6 +1,6 @@