Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.2] Hotfix - Brand url generation #862

Merged
merged 15 commits into from
Feb 15, 2023
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Lunar\Hub\Http\Livewire\Components\Brands;

use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Livewire\Component;
use Lunar\Hub\Http\Livewire\Traits\Notifies;
use Lunar\Models\Brand;
Expand Down Expand Up @@ -84,14 +83,7 @@ public function createBrand()
'name' => $this->brand['name'],
]);

$brand->urls()->create([
'slug' => Str::slug($this->brand['name']),
'default' => true,
'language_id' => Language::getDefault()->id,
]);

$this->brand = null;
$this->slug = null;

$this->showCreateForm = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function render()
{
return view('adminhub::livewire.pages.brands.show')
->layout('adminhub::layouts.app', [
'title' => 'Customers',
'title' => $this->brand->name,
]);
}
}
1 change: 0 additions & 1 deletion packages/core/tests/Unit/Models/BrandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
/**
* @group lunar.brands
*/

class BrandTest extends TestCase
{
use RefreshDatabase;
Expand Down
2 changes: 1 addition & 1 deletion packages/core/tests/Unit/Models/ProductOptionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function handle_if_not_unique_throw_exception()
$productOption = ProductOption::factory()->create();

$this->expectException(QueryException::class);
$this->expectWarningMessage('UNIQUE constraint failed');
$this->expectExceptionMessage('UNIQUE constraint failed');
ProductOption::factory()->create([
'handle' => $productOption->handle,
]);
Expand Down