Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/workflows/test-runner.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
name: Tests

on:
# Run testing on all push and pull requests for the main branch that have committed changes in PHP files
# Run testing on all push and pull requests that have committed changes in PHP files
push:
branches: [ "main" ]
paths:
- '**.php'
- '**/*.php'
pull_request:
branches: [ "main" ]
paths:
- '**.php'
- '**/*.php'
# Make it possible to run the workflow manually
workflow_dispatch:

Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
},
"require": {
"php": "^8.3",
"bezhansalleh/filament-shield": "^3.3",
"bezhansalleh/filament-shield": "^4.0",
"datalinx/php-utils": "^2.5",
"eclipsephp/common": "dev-main",
"eclipsephp/core": "dev-main",
"filament/filament": "^3.3",
"filament/filament": "^4.0",
"laravel/framework": "^12.0",
"spatie/laravel-package-tools": "^1.19"
},
Expand Down
21 changes: 11 additions & 10 deletions src/Admin/Filament/Pages/ManageFrontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,32 @@
use BezhanSalleh\FilamentShield\Traits\HasPageShield;
use Eclipse\Common\CommonPlugin;
use Eclipse\Frontend\Settings\FrontendSettings;
use Filament\Forms\Components;
use Filament\Forms\Form;
use Filament\Forms\Components\Toggle;
use Filament\Pages\SettingsPage;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Schema;
use Illuminate\Contracts\Support\Htmlable;

class ManageFrontend extends SettingsPage
{
use HasPageShield;

protected static ?string $navigationIcon = 'heroicon-o-building-storefront';
protected static string|\BackedEnum|null $navigationIcon = 'heroicon-o-building-storefront';

protected static string $settings = FrontendSettings::class;

public function form(Form $form): Form
public function form(Schema $schema): Schema
{
return $form
->schema([
Components\Section::make('User access')->schema([
Components\Toggle::make('guest_access')
return $schema
->components([
Section::make('User access')->schema([
Toggle::make('guest_access')
->label('Enable guest access')
->helperText('If enabled, users will not be required to login to access the frontend.'),
Components\Toggle::make('enable_logins')
Toggle::make('enable_logins')
->label('Enable user logins')
->helperText('If enabled, users will be able to login and manage their user account.'),
Components\Toggle::make('allow_registration')
Toggle::make('allow_registration')
->label('Allow user registrations')
->helperText('Allow new users to register on this site.'),
]),
Expand Down
7 changes: 4 additions & 3 deletions src/Filament/Pages/Home.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@
namespace Eclipse\Frontend\Filament\Pages;

use Filament\Pages\Page;
use Filament\Panel;

class Home extends Page
{
protected static ?int $navigationSort = -1;

protected static ?string $navigationIcon = '';
protected static string|\BackedEnum|null $navigationIcon = '';

protected static string $view = 'frontend-panel::filament.pages.home';
protected string $view = 'frontend-panel::filament.pages.home';

public function getHeading(): string
{
return '';
}

public static function getSlug(): string
public static function getSlug(?Panel $panel = null): string
{
return '/';
}
Expand Down
11 changes: 6 additions & 5 deletions src/Providers/FrontendPanelProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@
use Filament\Http\Middleware\AuthenticateSession;
use Filament\Http\Middleware\DisableBladeIconComponents;
use Filament\Http\Middleware\DispatchServingFilamentEvent;
use Filament\Pages;
use Filament\Pages\Dashboard;
use Filament\Panel;
use Filament\PanelProvider;
use Filament\Support\Colors\Color;
use Filament\Support\Enums\Platform;
use Filament\Support\Facades\FilamentView;
use Filament\View\PanelsRenderHook;
use Filament\Widgets;
use Filament\Widgets\AccountWidget;
use Filament\Widgets\FilamentInfoWidget;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Cookie\Middleware\EncryptCookies;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
Expand Down Expand Up @@ -53,10 +54,10 @@ public function panel(Panel $panel): Panel
$pages[] = CustomPages\Home::class;
} else {
$widgets = array_merge($widgets, [
Widgets\AccountWidget::class,
Widgets\FilamentInfoWidget::class,
AccountWidget::class,
FilamentInfoWidget::class,
]);
$pages[] = Pages\Dashboard::class;
$pages[] = Dashboard::class;
}

$panel
Expand Down
3 changes: 2 additions & 1 deletion tests/Pest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php

use Eclipse\Core\Database\Seeders\CoreSeeder;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;

/*
Expand All @@ -15,7 +16,7 @@
*/

uses(TestCase::class)
->use(Illuminate\Foundation\Testing\RefreshDatabase::class)
->use(RefreshDatabase::class)
->beforeEach(function () {
$this->seed(CoreSeeder::class);
})
Expand Down
Loading