Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
feat: update Laravel to 10 (#215)
Browse files Browse the repository at this point in the history
* feat: update Laravel to 10

* fix: fix tests for new jetstream livewire

* feat: run pipeline with 8.1

* feat: add jetstream components
  • Loading branch information
lightszentip authored Aug 28, 2024
1 parent c7b71c8 commit 249b7b8
Show file tree
Hide file tree
Showing 61 changed files with 867 additions and 399 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/laravel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- uses: shivammathur/setup-php@15b611248c3d140461e97b2eb10de461ca9ec5a3
with:
php-version: '8.0'
php-version: '8.1'
- uses: actions/checkout@v4
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
Expand Down
1 change: 0 additions & 1 deletion app/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class AuthServiceProvider extends ServiceProvider
*/
public function boot()
{
$this->registerPolicies();

//
}
Expand Down
33 changes: 17 additions & 16 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,24 @@
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
"php": "^7.4|^8.0|^8.1|^8.2",
"guzzlehttp/guzzle": "^7.5.0",
"laravel/framework": "^v9.43.0",
"laravel/jetstream": "^3.0.1",
"laravel/sanctum": "^3.0",
"laravel/tinker": "^v2.7.3",
"lightszentip/laravel-release-changelog-generator": "^0.3.0",
"livewire/livewire": "^v2.10.7",
"spatie/laravel-permission": "^5.7"
"php": "^8.1|^8.2",
"guzzlehttp/guzzle": "^7.9.2",
"laravel/framework": "^v10.48.20",
"laravel/jetstream": "^v4.3.1",
"laravel/sanctum": "^v3.3.3",
"laravel/tinker": "^v2.9.0",
"lightszentip/laravel-release-changelog-generator": "^0.3.5",
"livewire/livewire": "^v3.5.6",
"spatie/laravel-google-fonts": "^1.4",
"spatie/laravel-permission": "^5.11.1"
},
"require-dev": {
"spatie/laravel-ignition": "^2.0.0",
"fakerphp/faker": "^1.21.1",
"laravel/sail": "^1.16.4",
"mockery/mockery": "^1.5.1",
"nunomaduro/collision": "^v7.0.0",
"phpunit/phpunit": "^10.0.12"
"spatie/laravel-ignition": "^2.8.0",
"fakerphp/faker": "^v1.23.1",
"laravel/sail": "^v1.31.1",
"mockery/mockery": "^1.6.12",
"nunomaduro/collision": "^v7.10.0",
"phpunit/phpunit": "^10.5.30"
},
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -60,6 +61,6 @@
"preferred-install": "dist",
"sort-packages": true
},
"minimum-stability": "dev",
"minimum-stability": "stable",
"prefer-stable": true
}
251 changes: 116 additions & 135 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
},
"devDependencies": {
"@popperjs/core": "^2.11.8",
"axios": "^1.6.0",
"bootstrap": "^5.3.0",
"bootstrap-icons": "^1.10.5",
"jquery": "^3.7.0",
"axios": "^1.7.5",
"bootstrap": "^5.3.3",
"bootstrap-icons": "^1.11.3",
"jquery": "^3.7.1",
"laravel-mix": "^6.0.49",
"lodash": "^4.17.21",
"postcss": "^8.4.31",
"postcss-import": "^16.0.0",
"postcss": "^8.4.41",
"postcss-import": "^16.1.0",
"resolve-url-loader": "^5.0.0",
"sass-loader": "^13.3.2",
"sass": "^1.63.6"
"sass-loader": "^16.0.1",
"sass": "^1.77.8"
},
"dependencies": {
"dropzone": "^5.9.3",
Expand Down
1 change: 0 additions & 1 deletion resources/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {Tooltip} from 'bootstrap';
import Popper from '@popperjs/core/dist/umd/popper.js';

try {
window.Popper = Popper;
window.Popper = Popper;
window.$ = window.jQuery = require('jquery');
require('bootstrap');
Expand Down
64 changes: 32 additions & 32 deletions resources/views/api/api-token-manager.blade.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div>
<!-- Generate API Token -->
<x-jet-form-section submit="createApiToken">
<x-form-section submit="createApiToken">
<x-slot name="title">
{{ __('Create API Token') }}
</x-slot>
Expand All @@ -12,21 +12,21 @@
<x-slot name="form">
<!-- Token Name -->
<div class="col-span-6 sm:col-span-4">
<x-jet-label for="name" value="{{ __('Token Name') }}"/>
<x-jet-input id="name" type="text" class="mt-1 block w-full" wire:model.defer="createApiTokenForm.name"
<x-label for="name" value="{{ __('Token Name') }}"/>
<x-input id="name" type="text" class="mt-1 block w-full" wire:model="createApiTokenForm.name"
autofocus/>
<x-jet-input-error for="name" class="mt-2"/>
<x-input-error for="name" class="mt-2"/>
</div>

<!-- Token Permissions -->
@if (Laravel\Jetstream\Jetstream::hasPermissions())
<div class="col-span-6">
<x-jet-label for="permissions" value="{{ __('Permissions') }}"/>
<x-label for="permissions" value="{{ __('Permissions') }}"/>

<div class="mt-2 grid grid-cols-1 md:grid-cols-2 gap-4">
@foreach (Laravel\Jetstream\Jetstream::$permissions as $permission)
<label class="flex items-center">
<x-jet-checkbox wire:model.defer="createApiTokenForm.permissions" :value="$permission"/>
<x-checkbox wire:model="createApiTokenForm.permissions" :value="$permission"/>
<span class="ml-2 text-sm text-gray-600">{{ $permission }}</span>
</label>
@endforeach
Expand All @@ -36,22 +36,22 @@
</x-slot>

<x-slot name="actions">
<x-jet-action-message class="mr-3" on="created">
<x-action-message class="mr-3" on="created">
{{ __('Created.') }}
</x-jet-action-message>
</x-action-message>

<x-jet-button>
<x-button>
{{ __('Create') }}
</x-jet-button>
</x-button>
</x-slot>
</x-jet-form-section>
</x-form-section>

@if ($this->user->tokens->isNotEmpty())
<x-jet-section-border/>
<x-section-border/>

<!-- Manage API Tokens -->
<div class="mt-10 sm:mt-0">
<x-jet-action-section>
<x-action-section>
<x-slot name="title">
{{ __('Manage API Tokens') }}
</x-slot>
Expand Down Expand Up @@ -92,12 +92,12 @@
@endforeach
</div>
</x-slot>
</x-jet-action-section>
</x-action-section>
</div>
@endif

<!-- Token Value Modal -->
<x-jet-dialog-modal wire:model="displayingToken">
<x-dialog-modal wire:model.live="displayingToken">
<x-slot name="title">
{{ __('API Token') }}
</x-slot>
Expand All @@ -107,22 +107,22 @@
{{ __('Please copy your new API token. For your security, it won\'t be shown again.') }}
</div>

<x-jet-input x-ref="plaintextToken" type="text" readonly :value="$plainTextToken"
<x-input x-ref="plaintextToken" type="text" readonly :value="$plainTextToken"
class="mt-4 bg-gray-100 px-4 py-2 rounded font-mono text-sm text-gray-500 w-full"
autofocus autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
@showing-token-modal.window="setTimeout(() => $refs.plaintextToken.select(), 250)"
/>
</x-slot>

<x-slot name="footer">
<x-jet-secondary-button wire:click="$set('displayingToken', false)" wire:loading.attr="disabled">
<x-secondary-button wire:click="$set('displayingToken', false)" wire:loading.attr="disabled">
{{ __('Close') }}
</x-jet-secondary-button>
</x-secondary-button>
</x-slot>
</x-jet-dialog-modal>
</x-dialog-modal>

<!-- API Token Permissions Modal -->
<x-jet-dialog-modal wire:model="managingApiTokenPermissions">
<x-dialog-modal wire:model.live="managingApiTokenPermissions">
<x-slot name="title">
{{ __('API Token Permissions') }}
</x-slot>
Expand All @@ -131,27 +131,27 @@ class="mt-4 bg-gray-100 px-4 py-2 rounded font-mono text-sm text-gray-500 w-full
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
@foreach (Laravel\Jetstream\Jetstream::$permissions as $permission)
<label class="flex items-center">
<x-jet-checkbox wire:model.defer="updateApiTokenForm.permissions" :value="$permission"/>
<x-checkbox wire:model="updateApiTokenForm.permissions" :value="$permission"/>
<span class="ml-2 text-sm text-gray-600">{{ $permission }}</span>
</label>
@endforeach
</div>
</x-slot>

<x-slot name="footer">
<x-jet-secondary-button wire:click="$set('managingApiTokenPermissions', false)"
<x-secondary-button wire:click="$set('managingApiTokenPermissions', false)"
wire:loading.attr="disabled">
{{ __('Cancel') }}
</x-jet-secondary-button>
</x-secondary-button>

<x-jet-button class="ml-2" wire:click="updateApiToken" wire:loading.attr="disabled">
<x-button class="ml-2" wire:click="updateApiToken" wire:loading.attr="disabled">
{{ __('Save') }}
</x-jet-button>
</x-button>
</x-slot>
</x-jet-dialog-modal>
</x-dialog-modal>

<!-- Delete Token Confirmation Modal -->
<x-jet-confirmation-modal wire:model="confirmingApiTokenDeletion">
<x-confirmation-modal wire:model.live="confirmingApiTokenDeletion">
<x-slot name="title">
{{ __('Delete API Token') }}
</x-slot>
Expand All @@ -161,13 +161,13 @@ class="mt-4 bg-gray-100 px-4 py-2 rounded font-mono text-sm text-gray-500 w-full
</x-slot>

<x-slot name="footer">
<x-jet-secondary-button wire:click="$toggle('confirmingApiTokenDeletion')" wire:loading.attr="disabled">
<x-secondary-button wire:click="$toggle('confirmingApiTokenDeletion')" wire:loading.attr="disabled">
{{ __('Cancel') }}
</x-jet-secondary-button>
</x-secondary-button>

<x-jet-danger-button class="ml-2" wire:click="deleteApiToken" wire:loading.attr="disabled">
<x-danger-button class="ml-2" wire:click="deleteApiToken" wire:loading.attr="disabled">
{{ __('Delete') }}
</x-jet-danger-button>
</x-danger-button>
</x-slot>
</x-jet-confirmation-modal>
</x-confirmation-modal>
</div>
16 changes: 8 additions & 8 deletions resources/views/auth/confirm-password.blade.php
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
<x-guest-layout>
<x-jet-authentication-card>
<x-authentication-card>
<x-slot name="logo">
<x-jet-authentication-card-logo/>
<x-authentication-card-logo/>
</x-slot>

<div class="mb-4 text-sm text-gray-600">
{{ __('This is a secure area of the application. Please confirm your password before continuing.') }}
</div>

<x-jet-validation-errors class="mb-4"/>
<x-validation-errors class="mb-4"/>

<form method="POST" action="{{ route('password.confirm') }}">
@csrf

<div>
<x-jet-label for="password" value="{{ __('Password') }}"/>
<x-jet-input id="password" class="block mt-1 w-full" type="password" name="password" required
<x-label for="password" value="{{ __('Password') }}"/>
<x-input id="password" class="block mt-1 w-full" type="password" name="password" required
autocomplete="current-password" autofocus/>
</div>

<div class="flex justify-end mt-4">
<x-jet-button class="ml-4">
<x-button class="ml-4">
{{ __('Confirm') }}
</x-jet-button>
</x-button>
</div>
</form>
</x-jet-authentication-card>
</x-authentication-card>
</x-guest-layout>
16 changes: 8 additions & 8 deletions resources/views/auth/forgot-password.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<x-guest-layout>
<x-jet-authentication-card>
<x-authentication-card>
<x-slot name="logo">
<x-jet-authentication-card-logo/>
<x-authentication-card-logo/>
</x-slot>

<div class="mb-4 text-sm text-gray-600">
Expand All @@ -14,22 +14,22 @@
</div>
@endif

<x-jet-validation-errors class="mb-4"/>
<x-validation-errors class="mb-4"/>

<form method="POST" action="{{ route('password.email') }}">
@csrf

<div class="block">
<x-jet-label for="email" value="{{ __('Email') }}"/>
<x-jet-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')"
<x-label for="email" value="{{ __('Email') }}"/>
<x-input id="email" class="block mt-1 w-full" type="email" name="email" :value="old('email')"
required autofocus/>
</div>

<div class="flex items-center justify-end mt-4">
<x-jet-button>
<x-button>
{{ __('Email Password Reset Link') }}
</x-jet-button>
</x-button>
</div>
</form>
</x-jet-authentication-card>
</x-authentication-card>
</x-guest-layout>
22 changes: 11 additions & 11 deletions resources/views/auth/login.blade.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<x-guest-layout>
<main class="form-signin">
<x-jet-authentication-card>
<x-authentication-card>
<x-slot name="logo">
<x-jet-authentication-card-logo/>
<x-authentication-card-logo/>
</x-slot>

<x-jet-validation-errors class="mb-4"/>
<x-validation-errors class="mb-4"/>

@if (session('status'))
<div class="mb-4 font-medium text-sm text-green-600">
Expand All @@ -18,21 +18,21 @@
<h1 class="h3 mb-3 fw-normal">Please sign in</h1>
<div class="form-floating">

<x-jet-input id="email" class="form-control" type="email" name="email" :value="old('email')"
<x-input id="email" class="form-control" type="email" name="email" :value="old('email')"
required autofocus placeholder="[email protected]"/>
<x-jet-label for="email" value="{{ __('Email') }}"/>
<x-label for="email" value="{{ __('Email') }}"/>
</div>

<div class="form-floating">

<x-jet-input id="password" class="form-control" type="password" name="password" required
<x-input id="password" class="form-control" type="password" name="password" required
autocomplete="current-password" placeholder="Password"/>
<x-jet-label for="password" value="{{ __('Password') }}"/>
<x-label for="password" value="{{ __('Password') }}"/>
</div>

<div class="block mt-4">
<label for="remember_me" class="flex items-center">
<x-jet-checkbox id="remember_me" name="remember"/>
<x-checkbox id="remember_me" name="remember"/>
<span class="ml-2 text-sm text-gray-600">{{ __('Remember me') }}</span>
</label>
</div>
Expand All @@ -45,11 +45,11 @@
</a>
@endif

<x-jet-button class="ml-4">
<x-button class="ml-4">
{{ __('Log in') }}
</x-jet-button>
</x-button>
</div>
</form>
</x-jet-authentication-card>
</x-authentication-card>
</main>
</x-guest-layout>
Loading

0 comments on commit 249b7b8

Please sign in to comment.