Skip to content

Commit

Permalink
Merge pull request #369 from jeremykenedy/shift-34004
Browse files Browse the repository at this point in the history
Namespace Models
  • Loading branch information
jeremykenedy committed Sep 29, 2020
2 parents d1122eb + 8e62c3f commit 66d408a
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions app/Http/Middleware/CheckIsUserActivated.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function handle($request, Closure $next)
'welcome',
];

if (!in_array($currentRoute, $routesAllowed)) {
if (! in_array($currentRoute, $routesAllowed)) {
if ($user && $user->activated != 1) {
Log::info('Non-activated user attempted to visit '.$currentRoute.'. ', [$user]);

Expand Down Expand Up @@ -72,7 +72,7 @@ public function handle($request, Closure $next)
return redirect('home');
}

if (!$user) {
if (! $user) {
Log::info('Non registered visit to '.$currentRoute.'. ');

return redirect()->route('welcome');
Expand Down
6 changes: 3 additions & 3 deletions app/Logic/Macros/HtmlMacros.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
return $link;
});

/**
/*
* Render an icon with an anchor tag around it.
*
* @var string url
Expand All @@ -44,7 +44,7 @@
return $link;
});

/**
/*
* Render an button with an icon with an anchor tag around it.
*
* @var string url
Expand All @@ -65,7 +65,7 @@
return $link;
});

/**
/*
* Show Username.
*
* @return string
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Activation.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@ class Activation extends Model
*/
public function user()
{
return $this->belongsTo('App\Models\User');
return $this->belongsTo(\App\Models\User::class);
}
}
4 changes: 2 additions & 2 deletions app/Models/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Profile extends Model
*/
public function user()
{
return $this->belongsTo('App\Models\User');
return $this->belongsTo(\App\Models\User::class);
}

/**
Expand All @@ -59,6 +59,6 @@ public function user()
*/
public function theme()
{
return $this->hasOne('App\Models\Theme');
return $this->hasOne(\App\Models\Theme::class);
}
}
2 changes: 1 addition & 1 deletion app/Models/Social.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@ class Social extends Model
*/
public function user()
{
return $this->belongsTo('App\Models\User');
return $this->belongsTo(\App\Models\User::class);
}
}
2 changes: 1 addition & 1 deletion app/Models/Theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,6 @@ public static function rules($id = 0, $merge = [])
*/
public function profile()
{
return $this->hasMany('App\Models\Profile');
return $this->hasMany(\App\Models\Profile::class);
}
}
6 changes: 3 additions & 3 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,23 +107,23 @@ class User extends Authenticatable
*/
public function social()
{
return $this->hasMany('App\Models\Social');
return $this->hasMany(\App\Models\Social::class);
}

/**
* Get the profile associated with the user.
*/
public function profile()
{
return $this->hasOne('App\Models\Profile');
return $this->hasOne(\App\Models\Profile::class);
}

/**
* The profiles that belong to the user.
*/
public function profiles()
{
return $this->belongsToMany('App\Models\Profile')->withTimestamps();
return $this->belongsToMany(\App\Models\Profile::class)->withTimestamps();
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Providers/ComposerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function boot()
{
View::composer(
'layouts.app',
'App\Http\ViewComposers\ThemeComposer'
\App\Http\ViewComposers\ThemeComposer::class
);
}

Expand Down
8 changes: 4 additions & 4 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
// User Profile and Account Routes
Route::resource(
'profile',
'App\Http\Controllers\ProfilesController',
\App\Http\Controllers\ProfilesController::class,
[
'only' => [
'show',
Expand Down Expand Up @@ -103,13 +103,13 @@

// Registered, activated, and is admin routes.
Route::group(['middleware' => ['auth', 'activated', 'role:admin', 'activity', 'twostep', 'checkblocked']], function () {
Route::resource('/users/deleted', 'App\Http\Controllers\SoftDeletesController', [
Route::resource('/users/deleted', \App\Http\Controllers\SoftDeletesController::class, [
'only' => [
'index', 'show', 'update', 'destroy',
],
]);

Route::resource('users', 'App\Http\Controllers\UsersManagementController', [
Route::resource('users', \App\Http\Controllers\UsersManagementController::class, [
'names' => [
'index' => 'users',
'destroy' => 'user.destroy',
Expand All @@ -120,7 +120,7 @@
]);
Route::post('search-users', 'App\Http\Controllers\UsersManagementController@search')->name('search-users');

Route::resource('themes', 'App\Http\Controllers\ThemesManagementController', [
Route::resource('themes', \App\Http\Controllers\ThemesManagementController::class, [
'names' => [
'index' => 'themes',
'destroy' => 'themes.destroy',
Expand Down

0 comments on commit 66d408a

Please sign in to comment.