|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Author: Zahir Hayrullah |
|
4
|
|
|
* create date : 10/04/2020 07:00 AM |
|
5
|
|
|
* Last Modified Date: 10/04/2020 07:00 AM. |
|
6
|
|
|
*/ |
|
7
|
|
|
if (!function_exists('get_class_name')) { |
|
8
|
|
|
function get_class_name($name) |
|
9
|
|
|
{ |
|
10
|
|
|
if (strpos($name, 'App')) { |
|
11
|
|
|
return $name; |
|
12
|
|
|
} |
|
13
|
|
|
|
|
14
|
|
|
return '\\App\\'.$name; |
|
15
|
|
|
} |
|
16
|
|
|
} |
|
17
|
|
|
/*---------------------------------- </> ----------------------------------*/ |
|
18
|
|
|
|
|
19
|
|
|
if (!function_exists('get_item_if_exists')) { |
|
20
|
|
|
/** |
|
21
|
|
|
* @param $collection |
|
22
|
|
|
* @param $item |
|
23
|
|
|
* |
|
24
|
|
|
* @return mixed|null |
|
25
|
|
|
*/ |
|
26
|
|
|
function get_item_if_exists($collection, $item) |
|
27
|
|
|
{ |
|
28
|
|
|
return $collection->$item ?? null; |
|
29
|
|
|
} |
|
30
|
|
|
} |
|
31
|
|
|
/*---------------------------------- </> --------------------------------*/ |
|
32
|
|
|
|
|
33
|
|
|
if (!function_exists('list_of_models')) { |
|
34
|
|
|
/** |
|
35
|
|
|
* @return array |
|
36
|
|
|
*/ |
|
37
|
|
|
function list_of_models() |
|
38
|
|
|
{ |
|
39
|
|
|
return [ |
|
40
|
|
|
['name' => 'permission-groups', 'controller' => 'PermissionGroupController', 'except' => null, 'only' => null, 'model' => '\\App\\PermissionGroup'], |
|
41
|
|
|
['name' => 'permissions', 'controller' => 'PermissionController', 'except' => null, 'only' => null, 'model' => '\\App\\Permission'], |
|
42
|
|
|
['name' => 'users', 'controller' => 'UserController', 'except' => null, 'only' => null, 'model' => '\\App\\User'], |
|
43
|
|
|
['name' => 'roles', 'controller' => 'RoleController', 'except' => null, 'only' => null, 'model' => '\\App\\Role'], |
|
44
|
|
|
['name' => 'pages', 'controller' => 'PageController', 'except' => null, 'only' => null, 'model' => '\\App\\Page'], |
|
45
|
|
|
['name' => 'services', 'controller' => 'ServiceController', 'except' => null, 'only' => null, 'model' => '\\App\\Service'], |
|
46
|
|
|
['name' => 'categories', 'controller' => 'CategoryController', 'except' => null, 'only' => null, 'model' => '\\App\\Category'], |
|
47
|
|
|
['name' => 'posts', 'controller' => 'PostController', 'except' => null, 'only' => null, 'model' => '\\App\\Post'], |
|
48
|
|
|
['name' => 'tags', 'controller' => 'TagController', 'except' => null, 'only' => null, 'model' => '\\App\\Tag'], |
|
49
|
|
|
['name' => 'books', 'controller' => 'BookController', 'except' => null, 'only' => null, 'model' => '\\App\\Book'], |
|
50
|
|
|
['name' => 'likes', 'controller' => 'LikeController', 'except' => null, 'only' => null, 'model' => '\\App\\Like'], |
|
51
|
|
|
['name' => 'comments', 'controller' => 'CommentController', 'except' => null, 'only' => null, 'model' => '\\App\\Comment'], |
|
52
|
|
|
['name' => 'faqs', 'controller' => 'FaqController', 'except' => null, 'only' => null, 'model' => '\\App\\Faq'], |
|
53
|
|
|
['name' => 'countries', 'controller' => 'CountryController', 'except' => null, 'only' => null, 'model' => '\\App\\Country'], |
|
54
|
|
|
['name' => 'cities', 'controller' => 'CityController', 'except' => null, 'only' => null, 'model' => '\\App\\City'], |
|
55
|
|
|
['name' => 'towns', 'controller' => 'TownController', 'except' => null, 'only' => null, 'model' => '\\App\\Town'], |
|
56
|
|
|
['name' => 'menus', 'controller' => 'MenuController', 'except' => null, 'only' => null, 'model' => '\\App\\Menu'], |
|
57
|
|
|
['name' => 'menu-items', 'controller' => 'MenuController', 'except' => null, 'only' => null, 'model' => '\\App\\MenuItem'], |
|
58
|
|
|
['name' => 'links', 'controller' => 'LinkController', 'except' => ['create', 'edit'], 'only' => null, 'model' => '\\App\\Link'], |
|
59
|
|
|
['name' => 'subscribers', 'controller' => 'SubscriberController', 'except' => null, 'only' => null, 'model' => '\\App\\Subscriber'], |
|
60
|
|
|
['name' => 'sliders', 'controller' => 'SliderController', 'except' => null, 'only' => null, 'model' => '\\App\\Slider'], |
|
61
|
|
|
['name' => 'banners', 'controller' => 'BannerController', 'except' => null, 'only' => null, 'model' => '\\App\\Banner'], |
|
62
|
|
|
['name' => 'settings', 'controller' => 'SettingController', 'except' => null, 'only' => null, 'model' => '\\App\\Setting'], |
|
63
|
|
|
['name' => 'record301s', 'controller' => 'Record301Controller', 'except' => null, 'only' => null, 'model' => '\\App\\Record301'], |
|
64
|
|
|
// ['name' => 'record404s', 'controller' => 'Record404Controller', 'except' => null, 'only' => null, 'model' => '\\App\\Record404'], |
|
65
|
|
|
// ['name' => 'record500s', 'controller' => 'Record500Controller', 'except' => null, 'only' => null, 'model' => '\\App\\Record500'], |
|
66
|
|
|
// ['name' => 'favorites', 'controller' => 'FavoriteController', 'except' => null, 'only' => null], |
|
67
|
|
|
// ['name' => 'mails', 'controller' => 'MailController', 'except' => null, 'only' => null], |
|
68
|
|
|
// ['name' => 'notifications', 'controller' => 'NotificationController', 'except' => null, 'only' => null], |
|
69
|
|
|
// ['name' => 'notes', 'controller' => 'NoteController', 'except' => null, 'only' => null], |
|
70
|
|
|
]; |
|
71
|
|
|
} |
|
72
|
|
|
} |
|
73
|
|
|
/*----------------------------------------------------------------------------------*/ |
|
74
|
|
|
|