Skip to content

Commit cfd7a47

Browse files
committed
chore: bump translatable package version and test model creation
1 parent 68cbf7b commit cfd7a47

File tree

5 files changed

+17
-6
lines changed

5 files changed

+17
-6
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"php": "^8.3",
2020
"illuminate/support": "^9.0 || ^10.0 || ^11.0 || ^12.0",
2121
"javaabu/helpers": "^1.61",
22-
"javaabu/translatable": "^1.1",
22+
"javaabu/translatable": "^1.13",
2323
"javaabu/menu-builder": "^1.6",
2424
"kalnoy/nestedset": "^6.0",
2525
"javaabu/auth": "^1.16",

database/migrations/create_categories_table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function up()
2626
$table->timestamps();
2727

2828
// slugs must be unique for the category
29-
$table->unique(['slug', 'type_id'], 'unique_type_slug');
29+
$table->unique(['slug', 'type_id'], 'unique_category_slug');
3030

3131
$table->foreign('type_id')
3232
->references('id')

src/Models/Post.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,12 @@ public function getAdminUrlAttribute(): string
159159
/**
160160
* Get the admin localized url
161161
*
162-
* @param null $locale
162+
* @param null $locale
163+
* @param string|null $route_name
164+
* @param string $portal
163165
* @return string
164166
*/
165-
public function getAdminLocalizedUrl($locale = null)
167+
public function getAdminLocalizedUrl($locale = null, ?string $route_name = null, string $portal = "admin"): string
166168
{
167169
return $this->url('show', $locale);
168170
}

tests/Feature/ExampleTest.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,21 @@
22

33
namespace Javaabu\Cms\Tests\Feature;
44

5+
use Illuminate\Foundation\Testing\RefreshDatabase;
6+
use Javaabu\Cms\Models\Post;
57
use Javaabu\Cms\Tests\TestCase;
68
use PHPUnit\Framework\Attributes\Test;
79

810
class ExampleTest extends TestCase
911
{
12+
use RefreshDatabase;
13+
1014
#[Test]
11-
public function it_can_test_the_feature_is_true(): void
15+
public function it_can_make_a_blank_post_object(): void
1216
{
13-
$this->assertTrue(true);
17+
$post = new Post();
18+
19+
$this->assertInstanceOf(Post::class, $post);
1420
}
21+
1522
}

tests/TestSupport/Providers/TestServiceProvider.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ class TestServiceProvider extends ServiceProvider
1212
public function boot()
1313
{
1414
$this->loadMigrationsFrom([
15+
__DIR__ . '/../../../vendor/javaabu/translatable/database/migrations',
1516
__DIR__ . '/../../../database/migrations',
1617
__DIR__ . '/../database',
18+
1719
]);
1820
}
1921

0 commit comments

Comments
 (0)