generated from spatie/package-skeleton-laravel
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
691bff4
commit ded6ef4
Showing
19 changed files
with
569 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,5 @@ docs | |
phpunit.xml | ||
phpstan.neon | ||
testbench.yaml | ||
vendor | ||
node_modules | ||
/vendor | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace App\Models\Passport; | ||
|
||
use Envor\Platform\Concerns\UsesPlatformConnection; | ||
use Laravel\Passport\AuthCode as PassportAuthCode; | ||
|
||
class AuthCode extends PassportAuthCode | ||
{ | ||
use UsesPlatformConnection; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace App\Models\Passport; | ||
|
||
use Envor\Platform\Concerns\UsesPlatformConnection; | ||
use Laravel\Passport\Client as PassportClient; | ||
|
||
class Client extends PassportClient | ||
{ | ||
use UsesPlatformConnection; | ||
} |
11 changes: 11 additions & 0 deletions
11
passport/stubs/app/Models/Passport/PersonalAccessClient.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace App\Models\Passport; | ||
|
||
use Envor\Platform\Concerns\UsesPlatformConnection; | ||
use Laravel\Passport\PersonalAccessClient as PassportPersonalAccessClient; | ||
|
||
class PersonalAccessClient extends PassportPersonalAccessClient | ||
{ | ||
use UsesPlatformConnection; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace App\Models\Passport; | ||
|
||
use Envor\Platform\Concerns\UsesPlatformConnection; | ||
use Laravel\Passport\RefreshToken as PassportRefreshToken; | ||
|
||
class RefreshToken extends PassportRefreshToken | ||
{ | ||
use UsesPlatformConnection; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
|
||
namespace App\Models\Passport; | ||
|
||
use Envor\Platform\Concerns\UsesPlatformConnection; | ||
use Laravel\Passport\Token as PassportToken; | ||
|
||
class Token extends PassportToken | ||
{ | ||
use UsesPlatformConnection; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
|
||
namespace App\Providers; | ||
|
||
use App\Models\Passport\AuthCode; | ||
use App\Models\Passport\Client; | ||
use App\Models\Passport\PersonalAccessClient; | ||
use App\Models\Passport\RefreshToken; | ||
use App\Models\Passport\Token; | ||
use Illuminate\Support\ServiceProvider; | ||
use Laravel\Passport\Passport; | ||
|
||
class ApiServiceProvider extends ServiceProvider | ||
{ | ||
/** | ||
* Register services. | ||
*/ | ||
public function register(): void | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Bootstrap services. | ||
*/ | ||
public function boot(): void | ||
{ | ||
Passport::tokensCan([ | ||
'create' => 'Create resources', | ||
'read' => 'Read Resources', | ||
'update' => 'Update Resources', | ||
'delete' => 'Delete Resources', | ||
]); | ||
|
||
// default scope for passport tokens | ||
Passport::setDefaultScope([ | ||
// 'create', | ||
'read', | ||
// 'update', | ||
// 'delete', | ||
]); | ||
|
||
Passport::useTokenModel(Token::class); | ||
Passport::useRefreshTokenModel(RefreshToken::class); | ||
Passport::useAuthCodeModel(AuthCode::class); | ||
Passport::useClientModel(Client::class); | ||
Passport::usePersonalAccessClientModel(PersonalAccessClient::class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<?php | ||
|
||
return [ | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Authentication Guards | ||
|-------------------------------------------------------------------------- | ||
| | ||
| Next, you may define every authentication guard for your application. | ||
| Of course, a great default configuration has been defined for you | ||
| which utilizes session storage plus the Eloquent user provider. | ||
| | ||
| All authentication guards have a user provider, which defines how the | ||
| users are actually retrieved out of your database or other storage | ||
| system used by the application. Typically, Eloquent is utilized. | ||
| | ||
| Supported: "session" | ||
| | ||
*/ | ||
|
||
'guards' => [ | ||
'web' => [ | ||
'driver' => 'session', | ||
'provider' => 'users', | ||
], | ||
|
||
'api' => [ | ||
'driver' => 'passport', | ||
'provider' => 'users', | ||
'hash' => false, | ||
], | ||
], | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Resetting Passwords | ||
|-------------------------------------------------------------------------- | ||
| | ||
| These configuration options specify the behavior of Laravel's password | ||
| reset functionality, including the table utilized for token storage | ||
| and the user provider that is invoked to actually retrieve users. | ||
| | ||
| The expiry time is the number of minutes that each reset token will be | ||
| considered valid. This security feature keeps tokens short-lived so | ||
| they have less time to be guessed. You may change this as needed. | ||
| | ||
| The throttle setting is the number of seconds a user must wait before | ||
| generating more password reset tokens. This prevents the user from | ||
| quickly generating a very large amount of password reset tokens. | ||
| | ||
*/ | ||
|
||
'passwords' => [ | ||
'users' => [ | ||
'provider' => 'users', | ||
'table' => 'password_reset_tokens', | ||
'connection' => env('PLATFORM_DB_CONNECTION', 'sqlite'), | ||
'expire' => 60, | ||
'throttle' => 60, | ||
], | ||
], | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<x-app-layout> | ||
<x-slot name="header"> | ||
<h2 class="text-xl font-semibold leading-tight text-gray-800"> | ||
{{ __('Api Tokens') }} | ||
</h2> | ||
</x-slot> | ||
|
||
<div> | ||
<div class="py-10 mx-auto max-w-7xl sm:px-6 lg:px-8"> | ||
@livewire('jetstream-passport.oauth-client-manager') | ||
</div> | ||
</div> | ||
|
||
<x-section-border /> | ||
|
||
<div> | ||
<div class="py-10 mx-auto max-w-7xl sm:px-6 lg:px-8"> | ||
@livewire('jetstream-passport.api-token-manager') | ||
</div> | ||
</div> | ||
</x-app-layout> |
65 changes: 65 additions & 0 deletions
65
passport/stubs/resources/views/vendor/passport/authorize.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<x-guest-layout> | ||
|
||
<div class="fixed top-0 min-w-full px-6 py-3 mb-0 text-center bg-white border-b-1 border-grey-light text-grey-lightest dark:bg-gray-800"> | ||
Authorization Request | ||
</div> | ||
|
||
<x-authentication-card> | ||
<x-slot name="logo"> | ||
<x-authentication-card-logo /> | ||
</x-slot> | ||
|
||
|
||
|
||
<div class="mb-4 text-sm text-gray-600 dark:text-gray-400"> | ||
<p><strong>{{ $client->name }}</strong> is requesting permission to access your account.</p> | ||
</div> | ||
|
||
<!-- Scope List --> | ||
@if (count($scopes) > 0) | ||
<div class="scopes"> | ||
<p><strong>This application will be able to:</strong></p> | ||
|
||
<ul> | ||
@foreach ($scopes as $scope) | ||
<li>{{ $scope->description }}</li> | ||
@endforeach | ||
</ul> | ||
</div> | ||
@endif | ||
|
||
<x-validation-errors class="mb-4" /> | ||
<div class="flex items-center justify-end mt-4"> | ||
|
||
<form method="POST" action="{{ route('passport.authorizations.deny') }}"> | ||
@csrf | ||
@method('DELETE') | ||
|
||
<input type="hidden" name="state" value="{{ $request->state }}"> | ||
<input type="hidden" name="client_id" value="{{ $client->id }}"> | ||
<input type="hidden" name="auth_token" value="{{ $authToken }}"> | ||
|
||
<div class="flex justify-end mt-4"> | ||
<x-button class="ml-4 bg-red-500 dark:bg-red-800"> | ||
{{ __('Cancel') }} | ||
</x-button> | ||
</div> | ||
</form> | ||
|
||
<form method="POST" action="{{ route('passport.authorizations.approve') }}"> | ||
@csrf | ||
|
||
<input type="hidden" name="state" value="{{ $request->state }}"> | ||
<input type="hidden" name="client_id" value="{{ $client->id }}"> | ||
<input type="hidden" name="auth_token" value="{{ $authToken }}"> | ||
<div class="flex justify-end mt-4"> | ||
<x-button class="ml-4"> | ||
{{ __('Authorize') }} | ||
</x-button> | ||
</div> | ||
</form> | ||
|
||
</div> | ||
|
||
</x-authentication-card> | ||
</x-guest-layout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?php | ||
|
||
use Illuminate\Http\Request; | ||
use Illuminate\Support\Facades\Route; | ||
|
||
Route::get('/user', function (Request $request) { | ||
return $request->user(); | ||
})->middleware('auth:api'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import defaultTheme from 'tailwindcss/defaultTheme'; | ||
import forms from '@tailwindcss/forms'; | ||
import typography from '@tailwindcss/typography'; | ||
|
||
/** @type {import('tailwindcss').Config} */ | ||
export default { | ||
content: [ | ||
'./vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php', | ||
'./vendor/headerx/laravel-jetstream-passport/resources/views/**/*.blade.php', | ||
'./vendor/laravel/jetstream/**/*.blade.php', | ||
'./storage/framework/views/*.php', | ||
'./resources/views/**/*.blade.php', | ||
], | ||
|
||
theme: { | ||
extend: { | ||
fontFamily: { | ||
sans: ['Figtree', ...defaultTheme.fontFamily.sans], | ||
}, | ||
}, | ||
}, | ||
|
||
plugins: [forms, typography], | ||
}; |
Oops, something went wrong.