Skip to content

Commit 2c21748

Browse files
authored
Merge pull request #499 from viralsolani/laravel_6.0
Laravel 6.0
2 parents 0dc6b99 + 2846775 commit 2c21748

40 files changed

+1227
-504
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
APP_DEMO=false
2-
APP_NAME="Laravel 5.8 AdminPanel"
2+
APP_NAME="Laravel 6.0 AdminPanel"
33
APP_ENV=local
44
APP_KEY=
55
APP_DEBUG=true

app/Console/Commands/InstallAppCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Illuminate\Support\Facades\Artisan;
99
use Illuminate\Support\Facades\DB;
1010
use Illuminate\Support\Facades\File;
11+
use Illuminate\Support\Str;
1112
use PDOException;
1213
use Symfony\Component\Console\Helper\SymfonyQuestionHelper;
1314
use Symfony\Component\Console\Question\Question;
@@ -217,7 +218,7 @@ protected function guessDatabaseName()
217218
$segments = array_reverse(explode(DIRECTORY_SEPARATOR, app_path()));
218219
$name = explode('.', $segments[1])[0];
219220

220-
return str_replace('-', '_', str_slug($name));
221+
return str_replace('-', '_', Str::slug($name));
221222
} catch (Exception $e) {
222223
return '';
223224
}

app/Helpers/activeHelpers.php

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
<?php
2+
3+
if (!function_exists('active_class')) {
4+
/**
5+
* Get the active class if the condition is not falsy.
6+
*
7+
* @param $condition
8+
* @param string $activeClass
9+
* @param string $inactiveClass
10+
*
11+
* @return string
12+
*/
13+
function active_class($condition, $activeClass = 'active', $inactiveClass = '')
14+
{
15+
return app('active')->getClassIf($condition, $activeClass, $inactiveClass);
16+
}
17+
}
18+
if (!function_exists('if_uri')) {
19+
/**
20+
* Check if the URI of the current request matches one of the specific URIs.
21+
*
22+
* @param array|string $uris
23+
*
24+
* @return bool
25+
*/
26+
function if_uri($uris)
27+
{
28+
return app('active')->checkUri($uris);
29+
}
30+
}
31+
if (!function_exists('if_uri_pattern')) {
32+
/**
33+
* Check if the current URI matches one of specific patterns (using `str_is`).
34+
*
35+
* @param array|string $patterns
36+
*
37+
* @return bool
38+
*/
39+
function if_uri_pattern($patterns)
40+
{
41+
return app('active')->checkUriPattern($patterns);
42+
}
43+
}
44+
if (!function_exists('if_query')) {
45+
/**
46+
* Check if one of the following condition is true:
47+
* + the value of $value is `false` and the current querystring contain the key $key
48+
* + the value of $value is not `false` and the current value of the $key key in the querystring equals to $value
49+
* + the value of $value is not `false` and the current value of the $key key in the querystring is an array that
50+
* contains the $value.
51+
*
52+
* @param string $key
53+
* @param mixed $value
54+
*
55+
* @return bool
56+
*/
57+
function if_query($key, $value)
58+
{
59+
return app('active')->checkQuery($key, $value);
60+
}
61+
}
62+
if (!function_exists('if_route')) {
63+
/**
64+
* Check if the name of the current route matches one of specific values.
65+
*
66+
* @param array|string $routeNames
67+
*
68+
* @return bool
69+
*/
70+
function if_route($routeNames)
71+
{
72+
return app('active')->checkRoute($routeNames);
73+
}
74+
}
75+
if (!function_exists('if_route_pattern')) {
76+
/**
77+
* Check the current route name with one or some patterns.
78+
*
79+
* @param array|string $patterns
80+
*
81+
* @return bool
82+
*/
83+
function if_route_pattern($patterns)
84+
{
85+
return app('active')->checkRoutePattern($patterns);
86+
}
87+
}
88+
if (!function_exists('if_route_param')) {
89+
/**
90+
* Check if the parameter of the current route has the correct value.
91+
*
92+
* @param $param
93+
* @param $value
94+
*
95+
* @return bool
96+
*/
97+
function if_route_param($param, $value)
98+
{
99+
return app('active')->checkRouteParam($param, $value);
100+
}
101+
}
102+
if (!function_exists('if_action')) {
103+
/**
104+
* Return 'active' class if current route action match one of provided action names.
105+
*
106+
* @param array|string $actions
107+
*
108+
* @return bool
109+
*/
110+
function if_action($actions)
111+
{
112+
return app('active')->checkAction($actions);
113+
}
114+
}
115+
if (!function_exists('if_controller')) {
116+
/**
117+
* Check if the current controller class matches one of specific values.
118+
*
119+
* @param array|string $controllers
120+
*
121+
* @return bool
122+
*/
123+
function if_controller($controllers)
124+
{
125+
return app('active')->checkController($controllers);
126+
}
127+
}
128+
if (!function_exists('current_controller')) {
129+
/**
130+
* Get the current controller class.
131+
*
132+
* @return string
133+
*/
134+
function current_controller()
135+
{
136+
return app('active')->getController();
137+
}
138+
}
139+
if (!function_exists('current_method')) {
140+
/**
141+
* Get the current controller method.
142+
*
143+
* @return string
144+
*/
145+
function current_method()
146+
{
147+
return app('active')->getMethod();
148+
}
149+
}
150+
if (!function_exists('current_action')) {
151+
/**
152+
* Get the current action string.
153+
*
154+
* @return string
155+
*/
156+
function current_action()
157+
{
158+
return app('active')->getAction();
159+
}
160+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
namespace App\Http\Requests\Backend\Notification;
4+
5+
use App\Http\Requests\Request;
6+
7+
/**
8+
* Class MarkNotificationRequest.
9+
*/
10+
class MarkNotificationRequest extends Request
11+
{
12+
/**
13+
* Determine if the user is authorized to make this request.
14+
*
15+
* @return bool
16+
*/
17+
public function authorize()
18+
{
19+
return '';
20+
}
21+
22+
/**
23+
* Get the validation rules that apply to the request.
24+
*
25+
* @return array
26+
*/
27+
public function rules()
28+
{
29+
return [
30+
];
31+
}
32+
}

app/Http/Responses/Backend/Blog/CreateResponse.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
class CreateResponse implements Responsable
88
{
99
protected $status;
10+
1011
protected $blogTags;
12+
1113
protected $blogCategories;
1214

1315
public function __construct($status, $blogCategories, $blogTags)

app/Http/Responses/Backend/Blog/EditResponse.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@
77
class EditResponse implements Responsable
88
{
99
protected $blog;
10+
1011
protected $status;
12+
1113
protected $blogTags;
14+
1215
protected $blogCategories;
1316

1417
public function __construct($blog, $status, $blogCategories, $blogTags)

app/Http/Responses/RedirectResponse.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
class RedirectResponse implements Responsable
88
{
99
protected $route;
10+
1011
protected $message;
1112

1213
public function __construct($route, $message)

app/Http/Utilities/Notification.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@
1818
abstract class Notification
1919
{
2020
protected $_message = null;
21+
2122
protected $_devices = null;
23+
2224
protected $_response = null;
25+
2326
protected $_body = null;
27+
2428
protected static $_url = null;
2529

2630
/*

app/Http/Utilities/NotificationIos.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ class NotificationIos extends Notification
77
const BADGE_ID = 0;
88

99
protected $_passPhrase = null; // for authentication of .pem file or password of .pem file
10+
1011
protected $_pemFile = null; // for send notificetion .pem file is must add in that code
12+
1113
protected static $_url = 'ssl://gateway.sandbox.push.apple.com:2195'; // url for send push message
1214

1315
const ERROR_PEM_NOTACCESSIBLE = 1; // exception error for file not get
16+
1417
const ERROR_PASSPHRASE_EMPTY = 2; // exception error for passphrese empty
18+
1519
const ERROR_CONNECTION_FAILED = 3; // exception error for connection failed
1620

1721
protected $sendNotification = 1; // exception error for connection failed

app/Http/Utilities/PushNotification.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,12 @@ public function _pushNotification($msg, $type, $devicetoken)
2828
return $this->_pushToIos($devicetoken, $msg);
2929

3030
return true;
31+
3132
break;
3233

3334
case 'android':
3435
return $this->_pushToAndroid($devicetoken, $msg);
36+
3537
break;
3638

3739
default:

0 commit comments

Comments
 (0)