Skip to content

Commit

Permalink
No error test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-layson committed Mar 5, 2024
1 parent f6d92de commit 76bffce
Show file tree
Hide file tree
Showing 24 changed files with 844 additions and 309 deletions.
647 changes: 525 additions & 122 deletions composer.lock

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,18 @@
<testsuites>
<testsuite name="Main">
<file>tests/Feature/InstallTest.php</file>
<!-- <file>tests/Feature/AuthorTest.php</file>
<file>tests/Feature/AuthorTest.php</file>
<file>tests/Feature/MakeUserTest.php</file>
<file>tests/Feature/PageTest.php</file>
<file>tests/Feature/TaxonomyTest.php</file> -->
<file>tests/Feature/TaxonomyTest.php</file>
</testsuite>
<testsuite name="Filament">
<file>tests/Filament/AuthorResourceTest.php</file>
<file>tests/Filament/PageResourceTest.php</file>
<file>tests/Filament/PermissionResourceTest.php</file>
<file>tests/Filament/RoleResourceTest.php</file>
<file>tests/Filament/TaxonomyResourceTest.php</file>
<file>tests/Filament/UserResourceTest.php</file>
</testsuite>
</testsuites>

Expand Down
4 changes: 2 additions & 2 deletions src/Filament/Resources/UserResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Portable\FilaCms\Filament\Resources;

use App\Models\User;
use Filament\Forms\Form;
use Filament\Tables;
use Filament\Tables\Table;
Expand All @@ -13,7 +12,7 @@ class UserResource extends AbstractConfigurableResource
{
use IsProtectedResource;

protected static ?string $model = User::class;
protected static ?string $model = null;

protected static string $configKey = 'fila-cms.users';

Expand All @@ -31,6 +30,7 @@ public static function form(Form $form): Form

public static function table(Table $table): Table
{
static::$model = config('auth.providers.users.model');
return $table
->columns(static::getTableColumns())
->filters([
Expand Down
4 changes: 2 additions & 2 deletions src/Models/AbstractContentResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ public function author()

public function createdBy()
{
return $this->belongsTo(User::class, 'created_user_id');
return $this->belongsTo(config('auth.providers.users.model'), 'created_user_id');
}

public function updatedBy()
{
return $this->belongsTo(User::class, 'updated_user_id');
return $this->belongsTo(config('auth.providers.users.model'), 'updated_user_id');
}

protected function status(): Attribute
Expand Down
1 change: 1 addition & 0 deletions testbench.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ migrations:

seeders:
- Workbench\Database\Seeders\DatabaseSeeder

workbench:
start: "/"
install: true
Expand Down
Loading

0 comments on commit 76bffce

Please sign in to comment.