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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Run `npm run build` afterwards.
## Demo data

```bash
php artisan modules:seed --module=blog --demo
php artisan modules:seed --module=blog --state=showcase
```

Adds sample posts, categories and tags, and a staff account (`blog@saucebase.dev`) that only sees the blog in the admin. It uses the `DEMO_PASSWORD` from `.env`.
Expand Down
4 changes: 2 additions & 2 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ tasks:

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

db:seed:demo:
db:seed:showcase:
desc: Seed the Blog module with sample content
cmd: '{{.APP}} php artisan modules:seed --module=blog --demo'
cmd: '{{.APP}} php artisan modules:seed --module=blog --state=showcase'

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

Expand Down
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
],
"require": {
"saucebase/core": "^2.12.0",
"saucebase/core": "^3.0",
"spatie/laravel-feed": "^4.5"
},
"extra": {
Expand All @@ -26,6 +26,9 @@
"vue",
"react"
]
},
"branch-alias": {
"dev-dev": "3.4.x-dev"
}
},
"autoload": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Modules\Blog\Models\Tag;
use Spatie\Permission\Models\Role;

class DemoBlogDatabaseSeeder extends Seeder
class ShowcaseBlogDatabaseSeeder extends Seeder
{
public function run(): void
{
Expand All @@ -31,7 +31,7 @@

$this->createPost([
'title' => 'What Is Saucebase? The Modular Laravel Starter Kit',
'excerpt' => 'Every SaaS starts the same way: weeks of setup before you write a single line of real product code. Saucebase is the modular Laravel starter kit that skips that part.',

Check warning on line 34 in database/seeders/ShowcaseBlogDatabaseSeeder.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Split this 194 characters long line (which is greater than 120 authorized).

See more on https://sonarcloud.io/project/issues?id=saucebase-dev_blog&issues=AaHgkSirL4I3xanu-EAO&open=AaHgkSirL4I3xanu-EAO&pullRequest=13
'content' => $content('post-1-what-is-saucebase.html'),
'status' => PostStatus::Published,
'published_at' => now()->subMonths(5),
Expand All @@ -41,7 +41,7 @@

$this->createPost([
'title' => 'Stop Rebuilding the Same Boilerplate Every Project',
'excerpt' => "If you've launched more than one Laravel app, you know the feeling — two weeks gone before you write any real product code. There's a better way.",

Check warning on line 44 in database/seeders/ShowcaseBlogDatabaseSeeder.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Split this 173 characters long line (which is greater than 120 authorized).

See more on https://sonarcloud.io/project/issues?id=saucebase-dev_blog&issues=AaHgkSirL4I3xanu-EAP&open=AaHgkSirL4I3xanu-EAP&pullRequest=13
'content' => $content('post-2-stop-rebuilding-boilerplate.html'),
'status' => PostStatus::Published,
'published_at' => now()->subMonths(4),
Expand All @@ -51,7 +51,7 @@

$this->createPost([
'title' => 'The Modern Laravel Stack: Inertia.js, Vue 3 or React, and Tailwind Done Right',
'excerpt' => "Modern web dev has a tension between server productivity and rich interactivity. Laravel, Inertia.js, and Tailwind resolve it — and Saucebase wires all the pieces together so you don't have to.",

Check warning on line 54 in database/seeders/ShowcaseBlogDatabaseSeeder.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Split this 221 characters long line (which is greater than 120 authorized).

See more on https://sonarcloud.io/project/issues?id=saucebase-dev_blog&issues=AaHgkSirL4I3xanu-EAQ&open=AaHgkSirL4I3xanu-EAQ&pullRequest=13
'content' => $content('post-3-vilt-stack.html'),
'status' => PostStatus::Published,
'published_at' => now()->subMonths(3),
Expand All @@ -61,7 +61,7 @@

$this->createPost([
'title' => 'Your First Module: Scaffold and Ship in Under 10 Minutes',
'excerpt' => "One Artisan command scaffolds a fully structured module — service provider, controller, routes, Vue pages, migrations, factory, tests, and Vite config. Here's how it works.",

Check warning on line 64 in database/seeders/ShowcaseBlogDatabaseSeeder.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Split this 200 characters long line (which is greater than 120 authorized).

See more on https://sonarcloud.io/project/issues?id=saucebase-dev_blog&issues=AaHgkSirL4I3xanu-EAR&open=AaHgkSirL4I3xanu-EAR&pullRequest=13
'content' => $content('post-4-your-first-module.html'),
'status' => PostStatus::Published,
'published_at' => now()->subMonths(2),
Expand All @@ -71,7 +71,7 @@

$this->createPost([
'title' => 'Auth, Billing, and Privacy: The Three Modules Every SaaS Needs',
'excerpt' => "Three modules every SaaS needs — and Saucebase ships them already built. Here's what's included and why they matter.",

Check warning on line 74 in database/seeders/ShowcaseBlogDatabaseSeeder.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Split this 144 characters long line (which is greater than 120 authorized).

See more on https://sonarcloud.io/project/issues?id=saucebase-dev_blog&issues=AaHgkSirL4I3xanu-EAS&open=AaHgkSirL4I3xanu-EAS&pullRequest=13
'content' => $content('post-5-auth-billing-privacy.html'),
'status' => PostStatus::Published,
'published_at' => now()->subMonth(),
Expand All @@ -81,7 +81,7 @@

$this->createPost([
'title' => 'Copy-and-Own: The Philosophy Behind Saucebase Modules',
'excerpt' => "Most starter kits give you a locked box. Saucebase takes the opposite approach: when you install a module, the source code lands in your repo and it's yours to read, edit, and own.",

Check warning on line 84 in database/seeders/ShowcaseBlogDatabaseSeeder.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Split this 208 characters long line (which is greater than 120 authorized).

See more on https://sonarcloud.io/project/issues?id=saucebase-dev_blog&issues=AaHgkSirL4I3xanu-EAT&open=AaHgkSirL4I3xanu-EAT&pullRequest=13
'content' => $content('post-6-copy-and-own.html'),
'status' => PostStatus::Published,
'published_at' => now()->subWeeks(2),
Expand All @@ -91,7 +91,7 @@

$this->createPost([
'title' => 'Vue or React? What about both!',
'excerpt' => 'Choosing a frontend framework used to mean committing to a stack for the life of your project. Saucebase 2.0 changes that — ship with Vue 3 or React 19, and every module works either way.',

Check warning on line 94 in database/seeders/ShowcaseBlogDatabaseSeeder.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Split this 215 characters long line (which is greater than 120 authorized).

See more on https://sonarcloud.io/project/issues?id=saucebase-dev_blog&issues=AaHgkSirL4I3xanu-EAU&open=AaHgkSirL4I3xanu-EAU&pullRequest=13
'content' => $content('post-7-vue-and-react.html'),
'status' => PostStatus::Published,
'published_at' => now()->subDays(3),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,33 @@
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Hash;
use Modules\Blog\Database\Seeders\DatabaseSeeder;
use Modules\Blog\Database\Seeders\DemoBlogDatabaseSeeder;
use Modules\Blog\Database\Seeders\ShowcaseBlogDatabaseSeeder;
use Tests\TestCase;

/**
* The demo ships a staff account for this module's admin area, so visitors can try a
* role that sees only part of the panel.
*/
class DemoStaffTest extends TestCase
class ShowcaseStaffTest extends TestCase
{
use RefreshDatabase;

public function test_the_demo_adds_a_staff_account_for_this_module_only(): void
{
$this->seed([DatabaseSeeder::class, DemoBlogDatabaseSeeder::class]);
$this->seed([DatabaseSeeder::class, ShowcaseBlogDatabaseSeeder::class]);

$staff = User::where('email', 'blog@saucebase.dev')->firstOrFail();

$this->assertSame(['blog admin'], $staff->getRoleNames()->all());
$this->assertEqualsCanonicalizing(['access admin panel', 'manage blog'], $staff->getAllPermissions()->pluck('name')->all());

Check warning on line 27 in tests/Feature/ShowcaseStaffTest.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Split this 132 characters long line (which is greater than 120 authorized).

See more on https://sonarcloud.io/project/issues?id=saucebase-dev_blog&issues=AaHgkSkWL4I3xanu-EAV&open=AaHgkSkWL4I3xanu-EAV&pullRequest=13
}

public function test_demo_accounts_use_the_configured_demo_password(): void
{
config(['saucebase.demo_password' => 'not-the-old-default']);

$this->seed([DatabaseSeeder::class, DemoBlogDatabaseSeeder::class]);
$this->seed([DatabaseSeeder::class, ShowcaseBlogDatabaseSeeder::class]);

$this->assertTrue(Hash::check('not-the-old-default', User::where('email', 'blog@saucebase.dev')->value('password')));

Check warning on line 36 in tests/Feature/ShowcaseStaffTest.php

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Split this 125 characters long line (which is greater than 120 authorized).

See more on https://sonarcloud.io/project/issues?id=saucebase-dev_blog&issues=AaHgkSkWL4I3xanu-EAW&open=AaHgkSkWL4I3xanu-EAW&pullRequest=13
}
}
Loading