Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ jobs:
test:
uses: saucebase-dev/saucebase/.github/workflows/test-module.yml@main
with:
module: Settings
module: settings
dependencies: saucebase/auth
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Other modules can add items to the `settings` group from their own `routes/navig

```bash
php artisan test --testsuite=Modules --filter='^Modules\\Settings\\Tests' # PHPUnit
npx playwright test --project="@Settings*" # E2E
npx playwright test --project="@settings*" # E2E
```

E2E tests in `tests/e2e/index.spec.ts` — basic settings page accessibility.
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2025 Saucebase
Copyright (c) 2026 Saucebase

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
10 changes: 8 additions & 2 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,17 @@ tasks:

test:e2e:
desc: Run E2E tests for Settings module
cmd: npx playwright test --project="@Settings*" {{.CLI_ARGS}}
cmd: npx playwright test --project="@settings*" {{.CLI_ARGS}}
interactive: true

# ── Database ──────────────────────────────────────────────────

db:seed:
desc: Seed the Settings module database
cmd: php artisan modules:seed --module=settings

# ── Code Generation ────────────────────────────────────────────

types:generate:
desc: Generate TypeScript types from PHP DTOs and enums
cmd: php artisan module:generate-types Settings
cmd: php artisan module:generate-types settings
17 changes: 0 additions & 17 deletions app/Providers/RouteServiceProvider.php

This file was deleted.

16 changes: 0 additions & 16 deletions app/Providers/SettingsServiceProvider.php

This file was deleted.

13 changes: 9 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"name": "saucebase/settings",
"description": "",
"description": "Settings module",
"type": "saucebase-module",
"license": "proprietary",
"version": "1.3.1",
Comment on lines +3 to +6
"authors": [
{
"name": "Saucebase",
Expand All @@ -10,13 +12,15 @@
],
"extra": {
"laravel": {
"providers": [],
"providers": [
"Modules\\Settings\\Providers\\SettingsServiceProvider"
],
"aliases": {}
}
},
"autoload": {
"psr-4": {
"Modules\\Settings\\": "app/",
"Modules\\Settings\\": "src/",
"Modules\\Settings\\Database\\Factories\\": "database/factories/",
"Modules\\Settings\\Database\\Seeders\\": "database/seeders/"
}
Expand All @@ -25,5 +29,6 @@
"psr-4": {
"Modules\\Settings\\Tests\\": "tests/"
}
}
},
"minimum-stability": "stable"
}
15 changes: 0 additions & 15 deletions module.json

This file was deleted.

27 changes: 1 addition & 26 deletions resources/js/app.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1 @@
import { registerIcon } from '@/lib/navigation';
import IconSettings from '~icons/lucide/settings';
import IconUserCircle from '~icons/lucide/user-circle';

import '../css/style.css';

/**
* Settings module setup
* Called during app initialization before mounting
*
* NOTE: Navigation registration has been moved to backend SettingsServiceProvider.
*/
export function setup() {
console.debug('Settings module loaded');

registerIcon('settings', IconSettings);
registerIcon('profile', IconUserCircle);
}

/**
* Settings module after mount logic
* Called after the app has been mounted
*/
export function afterMount(/* app: App */) {
console.debug('Settings module after mount logic executed');
}
export * from './vue/app';
26 changes: 26 additions & 0 deletions resources/js/vue/app.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { registerIcon } from '@/lib/navigation';
import IconSettings from '~icons/lucide/settings';
import IconUserCircle from '~icons/lucide/user-circle';

import '@modules/settings/resources/css/style.css';

/**
* Settings module setup
* Called during app initialization before mounting
*
* NOTE: Navigation registration has been moved to backend SettingsServiceProvider.
*/
Comment on lines +7 to +12
export function setup() {
console.debug('Settings module loaded');

registerIcon('settings', IconSettings);
registerIcon('profile', IconUserCircle);
}

/**
* Settings module after mount logic
* Called after the app has been mounted
*/
export function afterMount(/* app: App */) {
console.debug('Settings module after mount logic executed');
}
File renamed without changes.
File renamed without changes.
6 changes: 4 additions & 2 deletions routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
use Illuminate\Support\Facades\Route;
use Modules\Settings\Http\Controllers\SettingsController;

Route::middleware(['auth:sanctum'])->prefix('api/v1/settings')->group(function () {
Route::apiResource('settings', SettingsController::class, ['as' => 'api']);
Route::middleware('api')->group(function (): void {
Route::middleware(['auth:sanctum'])->prefix('api/v1/settings')->group(function (): void {
Route::apiResource('settings', SettingsController::class, ['as' => 'api']);
});
Comment on lines +6 to +9
});
8 changes: 4 additions & 4 deletions routes/navigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*/

// User menu - Settings
Navigation::add('Settings', route('settings.index'), function (Section $section) {
Navigation::add('Settings', fn () => route('settings.index'), function (Section $section) {
$section->attributes([
'group' => 'user',
'slug' => 'settings',
Expand All @@ -24,7 +24,7 @@
});

// Settings sidebar - General
Navigation::add('General', route('settings.index'), function (Section $section) {
Navigation::add('General', fn () => route('settings.index'), function (Section $section) {
$section->attributes([
'group' => 'settings',
'slug' => 'settings',
Expand All @@ -34,7 +34,7 @@
});

// Settings sidebar - Profile
Navigation::add('Profile', route('settings.profile'), function (Section $section) {
Navigation::add('Profile', fn () => route('settings.profile'), function (Section $section) {
$section->attributes([
'group' => 'settings',
'slug' => 'profile',
Expand All @@ -44,7 +44,7 @@
});

// Secondary navigation - Settings
Navigation::add('Settings', route('settings.index'), function (Section $section) {
Navigation::add('Settings', fn () => route('settings.index'), function (Section $section) {
$section->attributes([
'group' => 'secondary',
'slug' => 'settings',
Expand Down
46 changes: 24 additions & 22 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,36 @@
use Modules\Settings\Http\Controllers\ProfileController;
use Modules\Settings\Http\Controllers\SettingsController;

Route::group(['middleware' => [
'auth',
'verified',
'role:admin|user',
]], function () {
Route::prefix('settings')->group(function () {
Route::get('/', [SettingsController::class, 'index'])
->name('settings.index');
Route::middleware('web')->group(function (): void {
Route::group(['middleware' => [
'auth',
'verified',
'role:admin|user',
]], function (): void {
Route::prefix('settings')->group(function (): void {
Route::get('/', [SettingsController::class, 'index'])
->name('settings.index');

Route::get('profile', [ProfileController::class, 'show'])
->name('settings.profile');
Route::get('profile', [ProfileController::class, 'show'])
->name('settings.profile');

Route::get('profile/edit', [ProfileController::class, 'edit'])
->name('settings.profile.edit');
Route::get('profile/edit', [ProfileController::class, 'edit'])
->name('settings.profile.edit');

Route::patch('profile/info', [ProfileController::class, 'updateInfo'])
->name('settings.profile.update-info');
Route::patch('profile/info', [ProfileController::class, 'updateInfo'])
->name('settings.profile.update-info');

Route::post('profile/avatar', [ProfileController::class, 'updateAvatar'])
->name('settings.profile.update-avatar');
Route::post('profile/avatar', [ProfileController::class, 'updateAvatar'])
->name('settings.profile.update-avatar');

Route::delete('profile/avatar', [ProfileController::class, 'deleteAvatar'])
->name('settings.profile.delete-avatar');
Route::delete('profile/avatar', [ProfileController::class, 'deleteAvatar'])
->name('settings.profile.delete-avatar');

Route::get('profile/password', [PasswordController::class, 'edit'])
->name('settings.profile.password.edit');
Route::get('profile/password', [PasswordController::class, 'edit'])
->name('settings.profile.password.edit');

Route::put('profile/password', [PasswordController::class, 'update'])
->name('settings.profile.password.update');
Route::put('profile/password', [PasswordController::class, 'update'])
->name('settings.profile.password.update');
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ public function getId(): string
return 'settings';
}

public static function getNavigationGroupSort(): int
{
return 3;
}

public function boot(Panel $panel): void
{
$panel->navigationGroups([
Expand Down
9 changes: 9 additions & 0 deletions src/Providers/SettingsServiceProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace Modules\Settings\Providers;

use App\Providers\ModuleServiceProvider;

class SettingsServiceProvider extends ModuleServiceProvider
{
}
Loading