-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a60fab2
commit 33bdf71
Showing
20 changed files
with
180 additions
and
59 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,11 @@ | ||
<?php | ||
|
||
namespace Livewire\Attributes; | ||
|
||
use Livewire\Features\SupportWireModelingNestedComponents\Modelable as BaseModelable; | ||
|
||
#[\Attribute] | ||
class Modelable extends BaseModelable | ||
{ | ||
// | ||
} |
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,11 @@ | ||
<?php | ||
|
||
namespace Livewire\Attributes; | ||
|
||
use Livewire\Features\SupportProps\Prop as BaseProp; | ||
|
||
#[\Attribute] | ||
class Prop extends BaseProp | ||
{ | ||
// | ||
} |
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,11 @@ | ||
<?php | ||
|
||
namespace Livewire\Attributes; | ||
|
||
use Livewire\Features\SupportReactiveProps\ReactiveProp as BaseReactiveProp; | ||
|
||
#[\Attribute] | ||
class ReactiveProp extends BaseReactiveProp | ||
{ | ||
// | ||
} |
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,12 @@ | ||
<?php | ||
|
||
namespace Livewire\Attributes; | ||
|
||
use Livewire\Features\SupportValidation\Rule as BaseRule; | ||
|
||
#[\Attribute] | ||
class Rule extends BaseRule | ||
{ | ||
// | ||
} | ||
|
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,18 @@ | ||
<?php | ||
|
||
namespace Livewire\Features\SupportProps; | ||
|
||
use Livewire\Features\SupportAttributes\Attribute as LivewireAttribute; | ||
|
||
#[\Attribute] | ||
class Prop extends LivewireAttribute | ||
{ | ||
public function mount($params) | ||
{ | ||
$property = $this->getName(); | ||
|
||
if (! array_key_exists($property, $params)) return; | ||
|
||
$this->setValue($params[$property]); | ||
} | ||
} |
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,32 @@ | ||
<?php | ||
|
||
namespace Livewire\Features\SupportProps; | ||
|
||
use Livewire\Livewire; | ||
use Livewire\Component; | ||
use ReflectionObject; | ||
|
||
class UnitTest extends \Tests\TestCase | ||
{ | ||
/** @test */ | ||
function can_pass_prop_to_child_component() | ||
{ | ||
Livewire::test([new class extends Component { | ||
public $foo = 'bar'; | ||
|
||
public function render() { | ||
return '<livewire:child :oof="$foo" />'; | ||
} | ||
}, 'child' => new class extends Component { | ||
#[Prop] | ||
public $oof; | ||
|
||
public function render() { | ||
return '<div>{{ $oof }}</div>'; | ||
} | ||
|
||
}]) | ||
->assertSee('bar'); | ||
} | ||
} | ||
|
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
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
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
Oops, something went wrong.