-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Select filters can select multiple values (#35)
- Loading branch information
1 parent
6e72ca1
commit 5fb99ee
Showing
7 changed files
with
87 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace RamonRietdijk\LivewireTables\Concerns; | ||
|
||
trait CanBeMultiple | ||
{ | ||
protected bool $multiple = false; | ||
|
||
public function multiple(bool $multiple = true): static | ||
{ | ||
$this->multiple = $multiple; | ||
|
||
return $this; | ||
} | ||
|
||
public function isMultiple(): bool | ||
{ | ||
return $this->multiple; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
namespace RamonRietdijk\LivewireTables\Tests\Unit\Concerns; | ||
|
||
use RamonRietdijk\LivewireTables\Filters\SelectFilter; | ||
use RamonRietdijk\LivewireTables\Tests\TestCase; | ||
|
||
class CanBeMultipleTest extends TestCase | ||
{ | ||
/** @test */ | ||
public function it_can_be_multiple(): void | ||
{ | ||
$filter = SelectFilter::make('Name', 'name'); | ||
|
||
$this->assertFalse($filter->isMultiple()); | ||
|
||
$filter->multiple(true); | ||
|
||
$this->assertTrue($filter->isMultiple()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters