Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7b199de
Merge pull request #469 from viralsolani/develop
viralsolani Sep 30, 2019
ffdf989
Adopt Laravel coding style
laravel-shift Sep 30, 2019
0804320
Shift deprecated helpers
laravel-shift Sep 30, 2019
1aba639
Shift config files
laravel-shift Sep 30, 2019
50e49cc
Default config files
laravel-shift Sep 30, 2019
4907509
Shift Laravel dependencies
laravel-shift Sep 30, 2019
c5ed06b
Shift cleanup
laravel-shift Sep 30, 2019
bbbef6e
Shift return type of base TestCase methods
laravel-shift Sep 30, 2019
9312bbd
Apply fixes from StyleCI
viralsolani Sep 30, 2019
192b8ae
Merge pull request #471 from viralsolani/analysis-qJK9rk
viralsolani Sep 30, 2019
b5d7f55
Merge pull request #470 from viralsolani/shift-19113
viralsolani Sep 30, 2019
64f77e2
add active request helper
viralsolani Oct 1, 2019
407f5fa
Apply fixes from StyleCI
viralsolani Oct 1, 2019
23efbaa
Merge pull request #479 from viralsolani/analysis-8nOGay
viralsolani Oct 1, 2019
7475205
Fix the issue of log-viewer in laravel 5.6
krguptaa Oct 4, 2019
8ea3f6d
Merge pull request #488 from krguptaa/laravel_6.0
viralsolani Oct 4, 2019
6063fe4
Fix the issue of Active feature in laravel 6.0
krguptaa Oct 4, 2019
19e620c
Fix the issue style CI
krguptaa Oct 4, 2019
401aba6
Merge pull request #489 from krguptaa/laravel_6.0
viralsolani Oct 4, 2019
27159dd
Apply fixes from StyleCI
viralsolani Oct 4, 2019
a28d24b
Merge pull request #490 from viralsolani/analysis-8P4N29
viralsolani Oct 4, 2019
a0ef613
Merge branch 'develop' of https://github.com/viralsolani/laravel-admi…
viralsolani Oct 4, 2019
85b924c
Added the notification request file for notification controller
krguptaa Oct 9, 2019
2846775
Merge pull request #495 from krguptaa/laravel_6.0
viralsolani Oct 9, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
APP_DEMO=false
APP_NAME="Laravel 5.8 AdminPanel"
APP_NAME="Laravel 6.0 AdminPanel"
APP_ENV=local
APP_KEY=
APP_DEBUG=true
Expand Down
3 changes: 2 additions & 1 deletion app/Console/Commands/InstallAppCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Str;
use PDOException;
use Symfony\Component\Console\Helper\SymfonyQuestionHelper;
use Symfony\Component\Console\Question\Question;
Expand Down Expand Up @@ -217,7 +218,7 @@ protected function guessDatabaseName()
$segments = array_reverse(explode(DIRECTORY_SEPARATOR, app_path()));
$name = explode('.', $segments[1])[0];

return str_replace('-', '_', str_slug($name));
return str_replace('-', '_', Str::slug($name));
} catch (Exception $e) {
return '';
}
Expand Down
160 changes: 160 additions & 0 deletions app/Helpers/activeHelpers.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
<?php

if (!function_exists('active_class')) {
/**
* Get the active class if the condition is not falsy.
*
* @param $condition
* @param string $activeClass
* @param string $inactiveClass
*
* @return string
*/
function active_class($condition, $activeClass = 'active', $inactiveClass = '')
{
return app('active')->getClassIf($condition, $activeClass, $inactiveClass);
}
}
if (!function_exists('if_uri')) {
/**
* Check if the URI of the current request matches one of the specific URIs.
*
* @param array|string $uris
*
* @return bool
*/
function if_uri($uris)
{
return app('active')->checkUri($uris);
}
}
if (!function_exists('if_uri_pattern')) {
/**
* Check if the current URI matches one of specific patterns (using `str_is`).
*
* @param array|string $patterns
*
* @return bool
*/
function if_uri_pattern($patterns)
{
return app('active')->checkUriPattern($patterns);
}
}
if (!function_exists('if_query')) {
/**
* Check if one of the following condition is true:
* + the value of $value is `false` and the current querystring contain the key $key
* + the value of $value is not `false` and the current value of the $key key in the querystring equals to $value
* + the value of $value is not `false` and the current value of the $key key in the querystring is an array that
* contains the $value.
*
* @param string $key
* @param mixed $value
*
* @return bool
*/
function if_query($key, $value)
{
return app('active')->checkQuery($key, $value);
}
}
if (!function_exists('if_route')) {
/**
* Check if the name of the current route matches one of specific values.
*
* @param array|string $routeNames
*
* @return bool
*/
function if_route($routeNames)
{
return app('active')->checkRoute($routeNames);
}
}
if (!function_exists('if_route_pattern')) {
/**
* Check the current route name with one or some patterns.
*
* @param array|string $patterns
*
* @return bool
*/
function if_route_pattern($patterns)
{
return app('active')->checkRoutePattern($patterns);
}
}
if (!function_exists('if_route_param')) {
/**
* Check if the parameter of the current route has the correct value.
*
* @param $param
* @param $value
*
* @return bool
*/
function if_route_param($param, $value)
{
return app('active')->checkRouteParam($param, $value);
}
}
if (!function_exists('if_action')) {
/**
* Return 'active' class if current route action match one of provided action names.
*
* @param array|string $actions
*
* @return bool
*/
function if_action($actions)
{
return app('active')->checkAction($actions);
}
}
if (!function_exists('if_controller')) {
/**
* Check if the current controller class matches one of specific values.
*
* @param array|string $controllers
*
* @return bool
*/
function if_controller($controllers)
{
return app('active')->checkController($controllers);
}
}
if (!function_exists('current_controller')) {
/**
* Get the current controller class.
*
* @return string
*/
function current_controller()
{
return app('active')->getController();
}
}
if (!function_exists('current_method')) {
/**
* Get the current controller method.
*
* @return string
*/
function current_method()
{
return app('active')->getMethod();
}
}
if (!function_exists('current_action')) {
/**
* Get the current action string.
*
* @return string
*/
function current_action()
{
return app('active')->getAction();
}
}
32 changes: 32 additions & 0 deletions app/Http/Requests/Backend/Notification/MarkNotificationRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace App\Http\Requests\Backend\Notification;

use App\Http\Requests\Request;

/**
* Class MarkNotificationRequest.
*/
class MarkNotificationRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return '';
}

/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
];
}
}
2 changes: 2 additions & 0 deletions app/Http/Responses/Backend/Blog/CreateResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
class CreateResponse implements Responsable
{
protected $status;

protected $blogTags;

protected $blogCategories;

public function __construct($status, $blogCategories, $blogTags)
Expand Down
3 changes: 3 additions & 0 deletions app/Http/Responses/Backend/Blog/EditResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@
class EditResponse implements Responsable
{
protected $blog;

protected $status;

protected $blogTags;

protected $blogCategories;

public function __construct($blog, $status, $blogCategories, $blogTags)
Expand Down
1 change: 1 addition & 0 deletions app/Http/Responses/RedirectResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
class RedirectResponse implements Responsable
{
protected $route;

protected $message;

public function __construct($route, $message)
Expand Down
4 changes: 4 additions & 0 deletions app/Http/Utilities/Notification.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@
abstract class Notification
{
protected $_message = null;

protected $_devices = null;

protected $_response = null;

protected $_body = null;

protected static $_url = null;

/*
Expand Down
4 changes: 4 additions & 0 deletions app/Http/Utilities/NotificationIos.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ class NotificationIos extends Notification
const BADGE_ID = 0;

protected $_passPhrase = null; // for authentication of .pem file or password of .pem file

protected $_pemFile = null; // for send notificetion .pem file is must add in that code

protected static $_url = 'ssl://gateway.sandbox.push.apple.com:2195'; // url for send push message

const ERROR_PEM_NOTACCESSIBLE = 1; // exception error for file not get

const ERROR_PASSPHRASE_EMPTY = 2; // exception error for passphrese empty

const ERROR_CONNECTION_FAILED = 3; // exception error for connection failed

protected $sendNotification = 1; // exception error for connection failed
Expand Down
2 changes: 2 additions & 0 deletions app/Http/Utilities/PushNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@ public function _pushNotification($msg, $type, $devicetoken)
return $this->_pushToIos($devicetoken, $msg);

return true;

break;

case 'android':
return $this->_pushToAndroid($devicetoken, $msg);

break;

default:
Expand Down
2 changes: 2 additions & 0 deletions app/Models/Access/PasswordReset/PasswordReset.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
class PasswordReset extends BaseModel
{
public $timestamps = false;

protected $table = 'password_resets';

protected $fillable = [
'email',
'token',
Expand Down
10 changes: 10 additions & 0 deletions app/Models/Access/User/Traits/Attribute/UserAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ public function getStatusButtonAttribute($class)

return '<a class="'.$class.'" href="'.route('admin.access.user.mark', [$this, 1]).'"><i class="fa fa-check-square" data-toggle="tooltip" data-placement="top" title="'.trans('buttons.backend.access.users.activate').'"></i>'.$name.'</a>';
}

break;

case 1:
Expand All @@ -159,6 +160,7 @@ public function getStatusButtonAttribute($class)

return '<a class="'.$class.'" href="'.route('admin.access.user.mark', [$this, 0]).'"><i class="fa fa-square" data-toggle="tooltip" data-placement="top" title="'.trans('buttons.backend.access.users.deactivate').'"></i>'.$name.'</a>';
}

break;

default:
Expand Down Expand Up @@ -313,6 +315,7 @@ public function getActionButtonsByPermissionName($permissionName, $counter)
$button = ($counter <= 3) ? $this->getShowButtonAttribute($class) : '<li>'
.$this->getShowButtonAttribute($class).
'</li>';

break;
case 'edit-user':
$button = ($counter <= 3) ? $this->getEditButtonAttribute($class) : '<li>'
Expand All @@ -321,6 +324,7 @@ public function getActionButtonsByPermissionName($permissionName, $counter)
$button .= ($counter <= 3) ? $this->getChangePasswordButtonAttribute($class) : '<li>'
.$this->getChangePasswordButtonAttribute($class).
'</li>';

break;
case 'activate-user':
if (\Route::currentRouteName() == 'admin.access.user.deactivated.get') {
Expand All @@ -330,6 +334,7 @@ public function getActionButtonsByPermissionName($permissionName, $counter)
} else {
$button = '';
}

break;
case 'deactivate-user':
if (\Route::currentRouteName() == 'admin.access.user.get') {
Expand All @@ -339,6 +344,7 @@ public function getActionButtonsByPermissionName($permissionName, $counter)
} else {
$button = '';
}

break;
case 'delete-user':
if (access()->user()->id != $this->id) {
Expand All @@ -348,6 +354,7 @@ public function getActionButtonsByPermissionName($permissionName, $counter)
} else {
$button = '';
}

break;
case 'login-as-user':
if (access()->user()->id != $this->id) {
Expand All @@ -357,6 +364,7 @@ public function getActionButtonsByPermissionName($permissionName, $counter)
} else {
$button = '';
}

break;
case 'clear-user-session':
if (access()->user()->id != $this->id) {
Expand All @@ -366,9 +374,11 @@ public function getActionButtonsByPermissionName($permissionName, $counter)
} else {
$button = '';
}

break;
default:
$button = '';

break;
}

Expand Down
1 change: 1 addition & 0 deletions app/Models/Access/User/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class User extends Authenticatable
UserRelationship,
UserSendPasswordReset,
HasApiTokens;

/**
* The database table used by the model.
*
Expand Down
1 change: 1 addition & 0 deletions app/Notifications/Frontend/Auth/UserNeedsPasswordReset.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
class UserNeedsPasswordReset extends Notification
{
use Queueable;

/**
* The password reset token.
*
Expand Down
Loading