diff --git a/src/Models/Scopes/MyAppsScope.php b/src/Models/Scopes/MyAppsScope.php index 6a7df5c..e73cec7 100644 --- a/src/Models/Scopes/MyAppsScope.php +++ b/src/Models/Scopes/MyAppsScope.php @@ -3,9 +3,9 @@ namespace Kristories\Novassport\Models\Scopes; use Auth; +use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Scope; -use Illuminate\Database\Eloquent\Builder; class MyAppsScope implements Scope { diff --git a/src/Novassport.php b/src/Novassport.php index 8b4a6a9..2486c59 100644 --- a/src/Novassport.php +++ b/src/Novassport.php @@ -14,7 +14,7 @@ class Novassport extends Tool */ public function boot() { - Nova::script('novassport', __DIR__ . '/../dist/js/tool.js'); + Nova::script('novassport', __DIR__.'/../dist/js/tool.js'); Nova::resources([ \Kristories\Novassport\Resources\OauthMyApps::class, diff --git a/src/Observers/OauthClientObserver.php b/src/Observers/OauthClientObserver.php index 26b0d12..25cdbea 100644 --- a/src/Observers/OauthClientObserver.php +++ b/src/Observers/OauthClientObserver.php @@ -2,8 +2,9 @@ namespace Kristories\Novassport\Observers; -use Auth, Str; +use Auth; use Kristories\Novassport\Models\OauthClient; +use Str; class OauthClientObserver { @@ -15,10 +16,10 @@ class OauthClientObserver */ public function creating(OauthClient $client) { - $client->user_id = Auth::id(); - $client->secret = Str::random(40); - $client->revoked = false; + $client->user_id = Auth::id(); + $client->secret = Str::random(40); + $client->revoked = false; $client->personal_access_client = false; - $client->password_client = false; + $client->password_client = false; } } diff --git a/src/Policies/MyAppsPolicy.php b/src/Policies/MyAppsPolicy.php index c42fde2..6a3dc51 100644 --- a/src/Policies/MyAppsPolicy.php +++ b/src/Policies/MyAppsPolicy.php @@ -12,26 +12,32 @@ public function viewAny(): bool { return true; } + public function view(): bool { return true; } + public function create(): bool { return true; } + public function update(): bool { return true; } + public function delete(): bool { return true; } + public function restore(): bool { return true; } + public function forceDelete(): bool { return true; diff --git a/src/Resources/OauthMyApps.php b/src/Resources/OauthMyApps.php index b41b3d0..486470c 100644 --- a/src/Resources/OauthMyApps.php +++ b/src/Resources/OauthMyApps.php @@ -2,10 +2,10 @@ namespace Kristories\Novassport\Resources; -use Laravel\Nova\Resource; -use Laravel\Nova\Fields\ID; use Illuminate\Http\Request; +use Laravel\Nova\Fields\ID; use Laravel\Nova\Fields\Text; +use Laravel\Nova\Resource; class OauthMyApps extends Resource { diff --git a/src/ToolServiceProvider.php b/src/ToolServiceProvider.php index b79af79..81d9296 100644 --- a/src/ToolServiceProvider.php +++ b/src/ToolServiceProvider.php @@ -3,14 +3,14 @@ namespace Kristories\Novassport; use Gate; -use Laravel\Nova\Nova; -use Laravel\Nova\Events\ServingNova; use Illuminate\Support\Facades\Route; use Illuminate\Support\ServiceProvider; -use Kristories\Novassport\Models\OauthClient; -use Kristories\Novassport\Policies\MyAppsPolicy; use Kristories\Novassport\Http\Middleware\Authorize; +use Kristories\Novassport\Models\OauthClient; use Kristories\Novassport\Observers\OauthClientObserver; +use Kristories\Novassport\Policies\MyAppsPolicy; +use Laravel\Nova\Events\ServingNova; +use Laravel\Nova\Nova; class ToolServiceProvider extends ServiceProvider { @@ -21,11 +21,11 @@ class ToolServiceProvider extends ServiceProvider */ public function boot() { - $this->loadViewsFrom(__DIR__ . '/../resources/views', 'novassport'); - $this->loadTranslationsFrom(__DIR__ . '/../resources/lang', 'novassport'); + $this->loadViewsFrom(__DIR__.'/../resources/views', 'novassport'); + $this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'novassport'); $this->publishes([ - __DIR__ . '/../resources/lang' => resource_path('lang/vendor/novassport'), + __DIR__.'/../resources/lang' => resource_path('lang/vendor/novassport'), ], 'novassport'); $this->app->booted(function () { @@ -54,7 +54,7 @@ protected function routes() Route::middleware(['nova', Authorize::class]) ->prefix('nova-vendor/novassport') - ->group(__DIR__ . '/../routes/api.php'); + ->group(__DIR__.'/../routes/api.php'); } /**