mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
Apply Laravel coding style
Shift automatically applies the Laravel coding style - which uses the PSR-12 coding style as a base with some minor additions. You may customize the code style applied by configuring [Pint](https://laravel.com/docs/pint), [PHP CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer), or [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) for your project root. For more information on customizing the code style applied by Shift, [watch this short video](https://laravelshift.com/videos/shift-code-style).
This commit is contained in:
committed by
HolgerHatGarKeineNode
parent
a15ca4a2bc
commit
5776b01d15
@@ -2,8 +2,6 @@
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Models\Episode;
|
||||
use App\Observers\EpisodeObserver;
|
||||
use App\Support\Carbon;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\Date;
|
||||
@@ -16,6 +14,7 @@ class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
@@ -27,6 +26,7 @@ class AppServiceProvider extends ServiceProvider
|
||||
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
@@ -35,7 +35,7 @@ class AppServiceProvider extends ServiceProvider
|
||||
|
||||
Stringable::macro('initials', function () {
|
||||
$words = preg_split("/\s+/", $this);
|
||||
$initials = "";
|
||||
$initials = '';
|
||||
|
||||
foreach ($words as $w) {
|
||||
$initials .= $w[0];
|
||||
|
||||
@@ -14,16 +14,18 @@ class AuthServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The policy mappings for the application.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $policies = [
|
||||
Team::class => TeamPolicy::class,
|
||||
Role::class => RolePolicy::class,
|
||||
Team::class => TeamPolicy::class,
|
||||
Role::class => RolePolicy::class,
|
||||
Permission::class => PermissionPolicy::class,
|
||||
];
|
||||
|
||||
/**
|
||||
* Register any authentication / authorization services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
|
||||
@@ -26,10 +26,11 @@ class EventServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The event to listener mappings for the application.
|
||||
*
|
||||
* @var array<class-string, array<int, class-string>>
|
||||
*/
|
||||
protected $listen = [
|
||||
Login::class => [
|
||||
Login::class => [
|
||||
AddLoginReputation::class,
|
||||
],
|
||||
Registered::class => [
|
||||
@@ -39,6 +40,7 @@ class EventServiceProvider extends ServiceProvider
|
||||
|
||||
/**
|
||||
* Register any events for your application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
@@ -54,6 +56,7 @@ class EventServiceProvider extends ServiceProvider
|
||||
|
||||
/**
|
||||
* Determine if events and listeners should be automatically discovered.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function shouldDiscoverEvents()
|
||||
|
||||
@@ -20,6 +20,7 @@ class JetstreamServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
@@ -29,6 +30,7 @@ class JetstreamServiceProvider extends ServiceProvider
|
||||
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
@@ -50,7 +52,6 @@ class JetstreamServiceProvider extends ServiceProvider
|
||||
|
||||
if ($user &&
|
||||
Hash::check($request->password, $user->password)) {
|
||||
|
||||
return $user;
|
||||
}
|
||||
});
|
||||
@@ -58,6 +59,7 @@ class JetstreamServiceProvider extends ServiceProvider
|
||||
|
||||
/**
|
||||
* Configure the roles and permissions that are available within the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function configurePermissions()
|
||||
|
||||
@@ -36,6 +36,7 @@ class NovaServiceProvider extends NovaApplicationServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
@@ -46,12 +47,12 @@ class NovaServiceProvider extends NovaApplicationServiceProvider
|
||||
$comments = $request->user()
|
||||
->hasRole('super-admin') || $request->user()
|
||||
->can('CommentPolicy.viewAny') ? [
|
||||
MenuSection::make('Comments', [
|
||||
MenuItem::resource(Comment::class),
|
||||
])
|
||||
->icon('chat')
|
||||
->collapsable(),
|
||||
] : [];
|
||||
MenuSection::make('Comments', [
|
||||
MenuItem::resource(Comment::class),
|
||||
])
|
||||
->icon('chat')
|
||||
->collapsable(),
|
||||
] : [];
|
||||
|
||||
$adminItems = $request->user()
|
||||
->hasRole('super-admin') || $request->user()
|
||||
@@ -74,14 +75,14 @@ class NovaServiceProvider extends NovaApplicationServiceProvider
|
||||
$permissions = $request->user()
|
||||
->hasRole('super-admin') || $request->user()
|
||||
->can('PermissionPolicy.viewAny') ? [
|
||||
MenuSection::make(__('nova-spatie-permissions::lang.sidebar_label'), [
|
||||
MenuItem::link(__('nova-spatie-permissions::lang.sidebar_label_roles'), 'resources/roles'),
|
||||
MenuItem::link(__('nova-spatie-permissions::lang.sidebar_label_permissions'),
|
||||
'resources/permissions'),
|
||||
])
|
||||
->icon('key')
|
||||
->collapsable(),
|
||||
] : [];
|
||||
MenuSection::make(__('nova-spatie-permissions::lang.sidebar_label'), [
|
||||
MenuItem::link(__('nova-spatie-permissions::lang.sidebar_label_roles'), 'resources/roles'),
|
||||
MenuItem::link(__('nova-spatie-permissions::lang.sidebar_label_permissions'),
|
||||
'resources/permissions'),
|
||||
])
|
||||
->icon('key')
|
||||
->collapsable(),
|
||||
] : [];
|
||||
|
||||
return array_merge([
|
||||
MenuSection::dashboard(Main::class)
|
||||
@@ -158,17 +159,17 @@ class NovaServiceProvider extends NovaApplicationServiceProvider
|
||||
|
||||
Nova::footer(function ($request) {
|
||||
// return MIT license and date
|
||||
return sprintf("%s %s - %s", date('Y'), config('app.name'), __('MIT License'));
|
||||
return sprintf('%s %s - %s', date('Y'), config('app.name'), __('MIT License'));
|
||||
});
|
||||
|
||||
Nova::userTimezone(function (Request $request) {
|
||||
|
||||
return $request->user()->timezone;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the tools that should be listed in the Nova sidebar.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function tools()
|
||||
@@ -180,6 +181,7 @@ class NovaServiceProvider extends NovaApplicationServiceProvider
|
||||
|
||||
/**
|
||||
* Register the Nova routes.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function routes()
|
||||
@@ -192,6 +194,7 @@ class NovaServiceProvider extends NovaApplicationServiceProvider
|
||||
|
||||
/**
|
||||
* Register any application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
@@ -202,6 +205,7 @@ class NovaServiceProvider extends NovaApplicationServiceProvider
|
||||
/**
|
||||
* Register the Nova gate.
|
||||
* This gate determines who can access Nova in non-local environments.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function gate()
|
||||
@@ -213,6 +217,7 @@ class NovaServiceProvider extends NovaApplicationServiceProvider
|
||||
|
||||
/**
|
||||
* Get the dashboards that should be listed in the Nova sidebar.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function dashboards()
|
||||
|
||||
@@ -13,12 +13,14 @@ class RouteServiceProvider extends ServiceProvider
|
||||
/**
|
||||
* The path to the "home" route for your application.
|
||||
* Typically, users are redirected here after authentication.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const HOME = '/';
|
||||
|
||||
/**
|
||||
* Define your route model bindings, pattern filters, and other route configuration.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
@@ -37,6 +39,7 @@ class RouteServiceProvider extends ServiceProvider
|
||||
|
||||
/**
|
||||
* Configure the rate limiters for the application.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function configureRateLimiting()
|
||||
|
||||
Reference in New Issue
Block a user