Commit 37a77d6a authored by Viral Solani's avatar Viral Solani Committed by StyleCI Bot

Apply fixes from StyleCI

parent de5ba46e
......@@ -2,19 +2,18 @@
namespace App\Http\Controllers\Backend\Access\User;
use App\Models\Access\User\User;
use Illuminate\Support\Facades\DB;
use App\Http\Controllers\Controller;
use App\Models\Access\Permission\Permission;
use App\Repositories\Backend\Access\Role\RoleRepository;
use App\Repositories\Backend\Access\User\UserRepository;
use App\Http\Requests\Backend\Access\User\EditUserRequest;
use App\Http\Requests\Backend\Access\User\ShowUserRequest;
use App\Http\Requests\Backend\Access\User\StoreUserRequest;
use App\Http\Requests\Backend\Access\User\CreateUserRequest;
use App\Http\Requests\Backend\Access\User\DeleteUserRequest;
use App\Http\Requests\Backend\Access\User\EditUserRequest;
use App\Http\Requests\Backend\Access\User\ManageUserRequest;
use App\Http\Requests\Backend\Access\User\ShowUserRequest;
use App\Http\Requests\Backend\Access\User\StoreUserRequest;
use App\Http\Requests\Backend\Access\User\UpdateUserRequest;
use App\Models\Access\User\User;
use App\Repositories\Backend\Access\Role\RoleRepository;
use App\Repositories\Backend\Access\User\UserRepository;
use Illuminate\Support\Facades\DB;
/**
* Class UserController.
......
......@@ -4,8 +4,8 @@ namespace App\Models\Access\Permission;
use App\Models\Access\Permission\Traits\Attribute\PermissionAttribute;
use App\Models\Access\Permission\Traits\Relationship\PermissionRelationship;
use App\Models\ModelTrait;
use App\Models\BaseModel;
use App\Models\ModelTrait;
use Illuminate\Database\Eloquent\SoftDeletes;
/**
......
......@@ -6,8 +6,8 @@ use App\Models\Access\Role\Traits\Attribute\RoleAttribute;
use App\Models\Access\Role\Traits\Relationship\RoleRelationship;
use App\Models\Access\Role\Traits\RoleAccess;
use App\Models\Access\Role\Traits\Scope\RoleScope;
use App\Models\ModelTrait;
use App\Models\BaseModel;
use App\Models\ModelTrait;
use Illuminate\Database\Eloquent\SoftDeletes;
/**
......
......@@ -9,7 +9,6 @@ use App\Models\Access\User\Traits\UserAccess;
use App\Models\Access\User\Traits\UserSendPasswordReset;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Notifications\Notifiable;
/**
......
<?php namespace App\Models;
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class BaseModel extends Model
{
/**
* Generate drop-down select data with basic IDs
* Generate drop-down select data with basic IDs.
*
* @param null $id
* @param null $val
*
* @return array
*/
public static function getSelectData($id = null, $val = null)
{
$collection = parent::all();
return self::getItems($collection);
}
/**
* Generate items for drop-down select data with basic IDs
* Generate items for drop-down select data with basic IDs.
*
* @param $collection
*
* @return array
*/
public static function getItems($collection)
{
$items = array();
$items = [];
foreach($collection as $model)
{
foreach ($collection as $model) {
$items[$model->id] = [
'id' => $model->id,
'name' => $model->name,
......@@ -37,14 +40,10 @@ class BaseModel extends Model
];
}
foreach($items as $id => $item)
{
if(isset(static::$selectHTMLFormat) && static::$selectHTMLFormat !== '')
{
foreach ($items as $id => $item) {
if (isset(static::$selectHTMLFormat) && static::$selectHTMLFormat !== '') {
$items[$item['id']] = static::generateSelectName($item['model'], static::$selectHTMLFormat);
}
else
{
} else {
$items[$item['id']] = $item['name'];
}
}
......
......@@ -3,10 +3,10 @@
namespace App\Models\BlogCategories;
use App\Models\BaseModel;
use App\Models\ModelTrait;
use Illuminate\Database\Eloquent\SoftDeletes;
use App\Models\BlogCategories\Traits\Attribute\BlogCategoryAttribute;
use App\Models\BlogCategories\Traits\Relationship\BlogCategoryRelationship;
use App\Models\ModelTrait;
use Illuminate\Database\Eloquent\SoftDeletes;
class BlogCategory extends BaseModel
{
......
......@@ -2,10 +2,10 @@
namespace App\Models\BlogTags;
use App\Models\BaseModel;
use App\Models\BlogTags\Traits\Attribute\BlogTagAttribute;
use App\Models\BlogTags\Traits\Relationship\BlogTagRelationship;
use App\Models\ModelTrait;
use App\Models\BaseModel;
use Illuminate\Database\Eloquent\SoftDeletes;
class BlogTag extends BaseModel
......
......@@ -2,10 +2,10 @@
namespace App\Models\Blogs;
use App\Models\BaseModel;
use App\Models\Blogs\Traits\Attribute\BlogAttribute;
use App\Models\Blogs\Traits\Relationship\BlogRelationship;
use App\Models\ModelTrait;
use App\Models\BaseModel;
use Illuminate\Database\Eloquent\SoftDeletes;
class Blog extends BaseModel
......
......@@ -2,8 +2,8 @@
namespace App\Models\Cities;
use App\Models\Cities\Traits\Relationship\CityRelationship;
use App\Models\BaseModel;
use App\Models\Cities\Traits\Relationship\CityRelationship;
class City extends BaseModel
{
......
......@@ -2,9 +2,9 @@
namespace App\Models\EmailTemplates;
use App\Models\BaseModel;
use App\Models\EmailTemplates\Traits\Attribute\EmailTemplateAttribute;
use App\Models\ModelTrait;
use App\Models\BaseModel;
use Illuminate\Database\Eloquent\SoftDeletes;
class EmailTemplate extends BaseModel
......
......@@ -2,9 +2,9 @@
namespace App\Models\Faqs;
use App\Models\BaseModel;
use App\Models\Faqs\Traits\Attribute\FaqAttribute;
use App\Models\ModelTrait;
use App\Models\BaseModel;
use Illuminate\Database\Eloquent\SoftDeletes;
class Faq extends BaseModel
......
......@@ -2,8 +2,8 @@
namespace App\Models\History;
use App\Models\History\Traits\Relationship\HistoryRelationship;
use App\Models\BaseModel;
use App\Models\History\Traits\Relationship\HistoryRelationship;
/**
* Class History
......
......@@ -4,8 +4,8 @@ namespace App\Models\Page;
use App\Models\BaseModel;
use App\Models\ModelTrait;
use Illuminate\Database\Eloquent\SoftDeletes;
use App\Models\Page\Traits\Attribute\PageAttribute;
use Illuminate\Database\Eloquent\SoftDeletes;
class Page extends BaseModel
{
......
......@@ -2,8 +2,8 @@
namespace App\Models\States;
use App\Models\States\Traits\Relationship\StateRelationship;
use App\Models\BaseModel;
use App\Models\States\Traits\Relationship\StateRelationship;
class State extends BaseModel
{
......
......@@ -5,7 +5,6 @@ namespace App\Repositories\Api\CmsPage;
use App\Exceptions\GeneralException;
use App\Models\CMSPages\CMSPage;
use App\Repositories\BaseRepository;
use App\Models\BaseModel;
/**
* Class CmsPageRepository.
......
......@@ -4,7 +4,6 @@ namespace App\Repositories\Api\Role;
use App\Models\Access\Role\Role;
use App\Repositories\BaseRepository;
use App\Models\BaseModel;
/**
* Class RoleRepository.
......
......@@ -4,7 +4,6 @@ namespace App\Repositories\Api\User;
use App\Models\Access\PasswordReset\PasswordReset;
use App\Repositories\BaseRepository;
use App\Models\BaseModel;
/**
* Class PermissionRepository.
......
......@@ -6,7 +6,6 @@ use App\Mail\ConfirmAcoountMail;
use App\Models\Access\User\User;
use App\Repositories\Backend\Access\Role\RoleRepository;
use App\Repositories\BaseRepository;
use App\Models\BaseModel;
/**
* Class PermissionRepository.
......
......@@ -9,7 +9,6 @@ use App\Exceptions\GeneralException;
use App\Models\Access\Permission\Permission;
use App\Repositories\BaseRepository;
use DB;
use App\Models\BaseModel;
/**
* Class PermissionRepository.
......
......@@ -8,7 +8,6 @@ use App\Events\Backend\Access\Role\RoleUpdated;
use App\Exceptions\GeneralException;
use App\Models\Access\Role\Role;
use App\Repositories\BaseRepository;
use App\Models\BaseModel;
use Illuminate\Support\Facades\DB;
/**
......
......@@ -14,7 +14,6 @@ use App\Exceptions\GeneralException;
use App\Models\Access\User\User;
use App\Repositories\Backend\Access\Role\RoleRepository;
use App\Repositories\BaseRepository;
use App\Models\BaseModel;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
......
......@@ -9,7 +9,6 @@ use App\Exceptions\GeneralException;
use App\Models\BlogCategories\BlogCategory;
use App\Repositories\BaseRepository;
use DB;
use App\Models\BaseModel;
/**
* Class BlogCategoriesRepository.
......
......@@ -9,7 +9,6 @@ use App\Exceptions\GeneralException;
use App\Models\BlogTags\BlogTag;
use App\Repositories\BaseRepository;
use DB;
use App\Models\BaseModel;
/**
* Class BlogTagsRepository.
......
......@@ -13,7 +13,6 @@ use App\Models\Blogs\Blog;
use App\Repositories\BaseRepository;
use Carbon\Carbon;
use DB;
use App\Models\BaseModel;
/**
* Class BlogsRepository.
......
......@@ -8,7 +8,6 @@ use App\Exceptions\GeneralException;
use App\Models\EmailTemplates\EmailTemplate;
use App\Repositories\BaseRepository;
use DB;
use App\Models\BaseModel;
/**
* Class EmailTemplatesRepository.
......
......@@ -5,7 +5,6 @@ namespace App\Repositories\Backend\Faqs;
use App\Exceptions\GeneralException;
use App\Models\Faqs\Faq;
use App\Repositories\BaseRepository;
use App\Models\BaseModel;
/**
* Class FaqsRepository.
......
......@@ -9,7 +9,6 @@ use App\Exceptions\GeneralException;
use App\Models\Page\Page;
use App\Repositories\BaseRepository;
use DB;
use App\Models\BaseModel;
/**
* Class PagesRepository.
......
......@@ -6,7 +6,6 @@ use App\Exceptions\GeneralException;
use App\Models\Settings\Setting;
use App\Repositories\BaseRepository;
use DB;
use App\Models\BaseModel;
/**
* Class SettingsRepository.
......
......@@ -5,7 +5,6 @@ namespace App\Repositories\Frontend\CMSPages;
use App\Exceptions\GeneralException;
use App\Models\CMSPages\CMSPage;
use App\Repositories\BaseRepository;
use App\Models\BaseModel;
/**
* Class CMSPagesRepository.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment