Skip to content

Commit

Permalink
Merge pull request #511 from viralsolani/develop
Browse files Browse the repository at this point in the history
Upgrade to Laravel 6.0
  • Loading branch information
viralsolani authored Oct 19, 2019
2 parents eb64611 + a3f1852 commit 4e9222e
Show file tree
Hide file tree
Showing 41 changed files with 897 additions and 646 deletions.
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ Start the local development server
php artisan serve



You can now access the server at http://localhost:8000

**Command list**
Expand Down Expand Up @@ -154,6 +153,7 @@ Feel free to create any pull requests for the project. For proposing any new cha
(1) Viral Solani - [email protected]
(2) Vipul Basapati - [email protected]
(3) Vallabh Kansagara - [email protected]
(4) Kamlesh Gupta - [email protected]

## License

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
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
1 change: 1 addition & 0 deletions app/Notifications/PasswordReset.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class PasswordReset extends Notification
* @return void
*/
protected $user;

protected $token;

public function __construct($user, $token)
Expand Down
2 changes: 2 additions & 0 deletions app/Repositories/Backend/Access/User/UserRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,12 @@ public function mark($user, $status)
switch ($status) {
case 0:
event(new UserDeactivated($user));

break;

case 1:
event(new UserReactivated($user));

break;
}

Expand Down
5 changes: 3 additions & 2 deletions app/Repositories/Backend/Blogs/BlogsRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Carbon\Carbon;
use DB;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;

/**
* Class BlogsRepository.
Expand Down Expand Up @@ -73,7 +74,7 @@ public function create(array $input)
unset($input['tags'], $input['categories']);

DB::transaction(function () use ($input, $tagsArray, $categoriesArray) {
$input['slug'] = str_slug($input['name']);
$input['slug'] = Str::slug($input['name']);
$input['publish_datetime'] = Carbon::parse($input['publish_datetime']);
$input = $this->uploadImage($input);
$input['created_by'] = access()->user()->id;
Expand Down Expand Up @@ -110,7 +111,7 @@ public function update(Blog $blog, array $input)
$categoriesArray = $this->createCategories($input['categories']);
unset($input['tags'], $input['categories']);

$input['slug'] = str_slug($input['name']);
$input['slug'] = Str::slug($input['name']);
$input['publish_datetime'] = Carbon::parse($input['publish_datetime']);
$input['updated_by'] = access()->user()->id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,18 +243,22 @@ public function renderDescription($text, $assets = false)
switch (count($values)) {
case 1:
$text = str_replace('{'.$key.'}', link_to_route($values[0], $values[0]), $text);

break;

case 2:
$text = str_replace('{'.$key.'}', link_to_route($values[0], $values[1]), $text);

break;

case 3:
$text = str_replace('{'.$key.'}', link_to_route($values[0], $values[1], $values[2]), $text);

break;

case 4:
$text = str_replace('{'.$key.'}', link_to_route($values[0], $values[1], $values[2], $values[3]), $text);

break;
}
} else {
Expand All @@ -266,6 +270,7 @@ public function renderDescription($text, $assets = false)

case 'string':
$text = str_replace('{'.$key.'}', $values, $text);

break;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class NotificationRepository extends BaseRepository
* @var object
*/
public $model;

public $timestamps = false;

public function __construct(Notification $model)
Expand Down
5 changes: 3 additions & 2 deletions app/Repositories/Backend/Pages/PagesRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use App\Exceptions\GeneralException;
use App\Models\Page\Page;
use App\Repositories\BaseRepository;
use Illuminate\Support\Str;

/**
* Class PagesRepository.
Expand Down Expand Up @@ -51,7 +52,7 @@ public function create(array $input)
}

// Making extra fields
$input['page_slug'] = str_slug($input['title']);
$input['page_slug'] = Str::slug($input['title']);
$input['status'] = isset($input['status']) ? 1 : 0;
$input['created_by'] = auth()->id();

Expand Down Expand Up @@ -79,7 +80,7 @@ public function update($page, array $input)
}

// Making extra fields
$input['page_slug'] = str_slug($input['title']);
$input['page_slug'] = Str::slug($input['title']);
$input['status'] = isset($input['status']) ? 1 : 0;
$input['updated_by'] = access()->user()->id;

Expand Down
Loading

0 comments on commit 4e9222e

Please sign in to comment.