Skip to content

Commit

Permalink
Merge pull request #15 from andrewdwallo/refractor
Browse files Browse the repository at this point in the history
Large Update
  • Loading branch information
andrewdwallo authored Jan 14, 2023
2 parents 1a07d49 + 83a5c5d commit fc57fc7
Show file tree
Hide file tree
Showing 63 changed files with 307 additions and 768 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<x-guest-layout>
<x-filament::layouts.card>

<div class="mb-4 text-sm text-gray-600 dark:text-gray-400">
{{ __('filament-companies::default.headings.auth.confirm_password') }}
Expand All @@ -20,4 +20,4 @@
</x-filament::button>
</div>
</form>
</x-guest-layout>
</x-filament::layouts.card>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<x-guest-layout>
<x-filament::layouts.card>

<h2 class="text-2xl font-bold tracking-tight text-center">
{{ __('filament-companies::default.headings.auth.forgot_password') }}
Expand Down Expand Up @@ -30,4 +30,4 @@
</x-filament::button>
</div>
</form>
</x-guest-layout>
</x-filament::layouts.card>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<x-guest-layout>
<x-filament::layouts.card>

<h2 class="text-2xl font-bold tracking-tight text-center">
{{ __('filament-companies::default.headings.auth.login') }}
Expand Down Expand Up @@ -52,4 +52,4 @@
</x-filament::button>
</div>
</form>
</x-guest-layout>
</x-filament::layouts.card>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<x-guest-layout>
<x-filament::layouts.card>

<h2 class="text-2xl font-bold tracking-tight text-center">
{{ __('filament-companies::default.headings.auth.register') }}
Expand Down Expand Up @@ -55,4 +55,4 @@
</x-filament::button>
</div>
</form>
</x-guest-layout>
</x-filament::layouts.card>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<x-guest-layout>
<x-filament::layouts.card>

<x-filament-companies::validation-errors class="mb-4" />

Expand Down Expand Up @@ -28,4 +28,4 @@
</x-filament::button>
</div>
</form>
</x-guest-layout>
</x-filament::layouts.card>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<x-guest-layout>
<x-filament::layouts.card>

<div x-data="{ recovery: false }">
<div class="mb-4 text-sm text-gray-600 dark:text-gray-400" x-show="! recovery">
Expand Down Expand Up @@ -49,4 +49,4 @@
</div>
</form>
</div>
</x-guest-layout>
</x-filament::layouts.card>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<x-guest-layout>
<x-filament::layouts.card>

<div class="mb-4 text-sm text-gray-600 dark:text-gray-400">
{{ __('filament-companies::default.headings.auth.verify_email.verification_link_not_sent') }}
Expand Down Expand Up @@ -37,4 +37,4 @@ class="underline text-sm text-gray-600 dark:text-gray-400 hover:text-gray-900"
</form>
</div>
</div>
</x-guest-layout>
</x-filament::layouts.card>
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
<!-- Company Settings -->
<x-filament::dropdown.list>
<x-filament::dropdown.list.item :icon="'heroicon-s-cog'">
<x-filament-companies::dropdown-link href="{{ route('filament.pages.show') }}">
<x-filament-companies::dropdown-link href="{{ url(\Wallo\FilamentCompanies\Pages\Companies\CompanySettings::getUrl()) }}">
{{ __('filament-companies::default.navigation.links.company_settings') }}
</x-filament-companies::dropdown-link>
</x-filament::dropdown.list.item>

@can('create', Wallo\FilamentCompanies\FilamentCompanies::newCompanyModel())
<x-filament::dropdown.list.item :icon="'heroicon-s-plus-circle'">
<x-filament-companies::dropdown-link href="{{ route('filament.pages.create') }}">
<x-filament-companies::dropdown-link href="{{ url(\Wallo\FilamentCompanies\Pages\Companies\CreateCompany::getUrl()) }}">
{{ __('filament-companies::default.navigation.links.new_company') }}
</x-filament-companies::dropdown-link>
</x-filament::dropdown.list.item>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<x-filament::page>
<div class="mt-10 sm:mt-0">
@livewire('companies.update-company-name-form', ['company' => $company])
@livewire(\Wallo\FilamentCompanies\Http\Livewire\UpdateCompanyNameForm::class, ['company' => $company])

<x-filament-companies::section-border />

@livewire('companies.company-employee-manager', ['company' => $company])
@livewire(\Wallo\FilamentCompanies\Http\Livewire\CompanyEmployeeManager::class, ['company' => $company])

<x-filament-companies::section-border />

@if (Gate::check('delete', $company) && ! $company->personal_company)

<div class="mt-10 sm:mt-0">
@livewire('companies.delete-company-form', ['company' => $company])
@livewire(\Wallo\FilamentCompanies\Http\Livewire\DeleteCompanyForm::class, ['company' => $company])
</div>
@endif

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<x-filament::page>
<div>
<div class="max-w-7xl mx-auto py-10 sm:px-6 lg:px-8">
@livewire('companies.create-company-form')
@livewire(\Wallo\FilamentCompanies\Http\Livewire\CreateCompanyForm::class, ['company' => $company])
</div>
</div>
</x-filament::page>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<x-filament::page>
<div>
<div class="max-w-7xl mx-auto py-10 sm:px-6 lg:px-8">
@livewire('api.api-token-manager')
@livewire(\Wallo\FilamentCompanies\Http\Livewire\ApiTokenManager::class)
</div>
</div>
</x-filament::page>
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,37 @@

@if (Laravel\Fortify\Features::canUpdateProfileInformation())
<div class="mt-10 sm:mt-0">
@livewire('profile.update-profile-information-form')
@livewire(\Wallo\FilamentCompanies\Http\Livewire\UpdateProfileInformationForm::class)
</div>

<x-filament-companies::section-border />
@endif

@if (Laravel\Fortify\Features::enabled(Laravel\Fortify\Features::updatePasswords()))
<div class="mt-10 sm:mt-0">
@livewire('profile.update-password-form')
@livewire(\Wallo\FilamentCompanies\Http\Livewire\UpdatePasswordForm::class)
</div>

<x-filament-companies::section-border />
@endif

@if (Laravel\Fortify\Features::canManageTwoFactorAuthentication())
<div class="mt-10 sm:mt-0">
@livewire('profile.two-factor-authentication-form')
@livewire(\Wallo\FilamentCompanies\Http\Livewire\TwoFactorAuthenticationForm::class)
</div>

<x-filament-companies::section-border />
@endif

<div class="mt-10 sm:mt-0">
@livewire('profile.logout-other-browser-sessions-form')
@livewire(\Wallo\FilamentCompanies\Http\Livewire\LogoutOtherBrowserSessionsForm::class)
</div>

@if (Wallo\FilamentCompanies\FilamentCompanies::hasAccountDeletionFeatures())
<x-filament-companies::section-border />

<div class="mt-10 sm:mt-0">
@livewire('profile.delete-user-form')
@livewire(\Wallo\FilamentCompanies\Http\Livewire\DeleteUserForm::class)
</div>
@endif
</x-filament::page>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<x-guest-layout>
<x-filament::layouts.card>
<div class="w-full sm:max-w-2xl mt-6 p-6 bg-white dark:bg-gray-800 shadow-md overflow-hidden sm:rounded-lg prose dark:prose-invert">
{!! $policy !!}
</div>
</x-guest-layout>
</x-filament::layouts.card>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<x-guest-layout>
<x-filament::layouts.card>
<div class="w-full sm:max-w-2xl mt-6 p-6 bg-white dark:bg-gray-800 shadow-md overflow-hidden sm:rounded-lg prose dark:prose-invert">
{!! $terms !!}
</div>
</x-guest-layout>
</x-filament::layouts.card>
54 changes: 30 additions & 24 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@

use Illuminate\Support\Facades\Route;
use Wallo\FilamentCompanies\Http\Controllers\CurrentCompanyController;
use Wallo\FilamentCompanies\Http\Controllers\Livewire\ApiTokenController;
use Wallo\FilamentCompanies\Http\Controllers\Livewire\PrivacyPolicyController;
use Wallo\FilamentCompanies\Http\Controllers\Livewire\CompanyController;
use Wallo\FilamentCompanies\Http\Controllers\Livewire\TermsOfServiceController;
use Wallo\FilamentCompanies\Http\Controllers\Livewire\UserProfileController;
use Wallo\FilamentCompanies\Http\Controllers\CompanyInvitationController;
use Wallo\FilamentCompanies\FilamentCompanies;
use Wallo\FilamentCompanies\Pages\Companies\CompanySettings;
use Wallo\FilamentCompanies\Pages\Companies\CreateCompany;
use Wallo\FilamentCompanies\Pages\User\APITokens;
use Wallo\FilamentCompanies\Pages\User\Profile;


Route::group(['middleware' => config('filament-companies.middleware', ['web'])], function () {

if (FilamentCompanies::hasTermsAndPrivacyPolicyFeature()) {
Route::get('/terms-of-service', [TermsOfServiceController::class, 'show'])->name('terms.show');
Route::get('/privacy-policy', [PrivacyPolicyController::class, 'show'])->name('policy.show');
Expand All @@ -24,28 +27,31 @@
? config('filament-companies.auth_session')
: null;


Route::group(['middleware' => array_values(array_filter([$authMiddleware, $authSessionMiddleware]))], function () {
// User & Profile...
Route::get('/user/profile', [UserProfileController::class, 'show'])->name('filament.pages.profile');

Route::group(['middleware' => 'verified'], function () {
// API...
if (FilamentCompanies::hasApiFeatures()) {
Route::get('/user/api-tokens', [ApiTokenController::class, 'index'])->name('filament.pages.api-tokens');

}

// Companies...
if (FilamentCompanies::hasCompanyFeatures()) {
Route::get('/companies/create', [CompanyController::class, 'create'])->name('filament.pages.create');

Route::get('/companies/{company}', [CompanyController::class, 'show'])->name('filament.pages.show');
Route::put('/current-company', [CurrentCompanyController::class, 'update'])->name('current-company.update');

Route::get('/company-invitations/{invitation}', [CompanyInvitationController::class, 'accept'])
->middleware(['signed'])
->name('company-invitations.accept');
}
Route::prefix(config('filament.path'))
->group(function () {
Route::get('/user/profile', Profile::class);

Route::group(['middleware' => 'verified'], function () {
// API...
if (FilamentCompanies::hasApiFeatures()) {
Route::get('/user/api-tokens', APITokens::class);
}

// Companies...
if (FilamentCompanies::hasCompanyFeatures()) {
Route::get('companies/create-company', CreateCompany::class);

Route::get('companies/company-settings', CompanySettings::class);
Route::put('/current-company', [CurrentCompanyController::class, 'update'])->name('current-company.update');

Route::get('/company-invitations/{invitation}', [CompanyInvitationController::class, 'accept'])
->middleware(['signed'])
->name('company-invitations.accept');
}
});
});
});
});
});
Loading

0 comments on commit fc57fc7

Please sign in to comment.