-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added tests to check if the hidden property is used
- Loading branch information
Showing
3 changed files
with
125 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* Contains the Order model class for Enum version 2 and 3 default. | ||
* | ||
* @copyright Copyright (c) 2023 Mark Boessenkool | ||
* @author Mark Boessenkool | ||
* @license MIT | ||
* @since 2023-08-02 | ||
* | ||
*/ | ||
|
||
namespace Konekt\Enum\Eloquent\Tests\Models; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
use Konekt\Enum\Eloquent\CastsEnums; | ||
|
||
class Visibility extends Model | ||
{ | ||
use CastsEnums; | ||
|
||
protected $guarded = ['id']; | ||
|
||
protected $casts = [ | ||
'is_active' => 'boolean' | ||
]; | ||
|
||
protected $enums = [ | ||
'talk1' => VisibilityTalk::class, | ||
'talk2' => VisibilityTalk::class, | ||
]; | ||
|
||
protected $hidden = [ | ||
'talk1', | ||
]; | ||
} |
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,25 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* Contains the VisibilityTalk class | ||
* | ||
* @copyright Copyright (c) 2023 Mark Boessenkool | ||
* @author Mark Boessenkool | ||
* @license MIT | ||
* @since 2023-08-02 | ||
* | ||
*/ | ||
|
||
namespace Konekt\Enum\Eloquent\Tests\Models; | ||
|
||
use Konekt\Enum\Enum; | ||
|
||
class VisibilityTalk extends Enum | ||
{ | ||
public const BLABLA = 'blabla'; | ||
public const YADDA = 'yadda'; | ||
public const ZIGZAG = 'zig zag'; | ||
public const PINGPONG = 'ping pong'; | ||
} |