-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add filament v3 compatibility
- Loading branch information
Showing
18 changed files
with
443 additions
and
120 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -1,48 +1,44 @@ | ||
<x-dynamic-component | ||
:component="$getFieldWrapperView()" | ||
:id="$getId()" | ||
:label="$getLabel()" | ||
:label-sr-only="$isLabelHidden()" | ||
:helper-text="$getHelperText()" | ||
:hint="$getHint()" | ||
:hint-action="$getHintAction()" | ||
:hint-color="$getHintColor()" | ||
:hint-icon="$getHintIcon()" | ||
:required="$isRequired()" | ||
:state-path="$getStatePath()" | ||
> | ||
<div x-data="{ | ||
state: $wire.entangle('{{ $getStatePath() }}').defer | ||
@php | ||
$statePath = $getStatePath(); | ||
$fieldWrapperView = $getFieldWrapperView(); | ||
$theme = $getTheme(); | ||
$size = $getSize(); | ||
$language = $getLanguage(); | ||
@endphp | ||
|
||
<x-dynamic-component :component="$fieldWrapperView" :field="$turnstile"> | ||
|
||
<div x-data="{ | ||
state: $wire.entangle('{{ $statePath }}').defer | ||
}" | ||
wire:ignore | ||
> | ||
<div id="turnstile-widget" | ||
data-sitekey="{{config('turnstile.turnstile_site_key')}}" | ||
data-theme="{{$getTheme()}}" | ||
data-language="{{$getLanguage()}}" | ||
data-size="{{$getSize()}}"> | ||
</div> | ||
</div> | ||
|
||
@push('scripts') | ||
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js?onload=onloadTurnstileCallback" defer></script> | ||
<script> | ||
let options = { | ||
callback: function(token) { | ||
window.Livewire | ||
.find('{{$this->id}}') | ||
.$set('{{$getStatePath()}}', token); | ||
x-init="(() => { | ||
let options= { | ||
callback: function (token) { | ||
$wire.set('{{ $statePath }}', token) | ||
}, | ||
errorCallback: function () { | ||
window.Livewire | ||
.find('{{$this->id}}') | ||
.$set('{{$getStatePath()}}', 'error'); | ||
} | ||
$wire.set('{{ $statePath }}', null) | ||
}, | ||
} | ||
window.onloadTurnstileCallback = () => { | ||
turnstile.render('#turnstile-widget', options) | ||
turnstile.render($refs.turnstile, options) | ||
} | ||
</script> | ||
})()" | ||
> | ||
<div data-sitekey="{{config('turnstile.turnstile_site_key')}}" | ||
data-theme="{{ $theme }}" | ||
data-language="{{ $language }}" | ||
data-size="{{ $size }}" | ||
x-ref="turnstile" | ||
> | ||
</div> | ||
</div> | ||
|
||
@push('scripts') | ||
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js?onload=onloadTurnstileCallback" defer></script> | ||
@endpush | ||
</x-dynamic-component> |
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,10 @@ | ||
<?php | ||
|
||
namespace Coderflex\FilamentTurnstile\Tests\Database\Factories; | ||
|
||
use Coderflex\FilamentTurnstile\Tests\Models\User; | ||
|
||
class UserFactory extends \Orchestra\Testbench\Factories\UserFactory | ||
{ | ||
protected $model = User::class; | ||
} |
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,19 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class() extends Migration | ||
{ | ||
public function up() | ||
{ | ||
Schema::create('contacts', function (Blueprint $table) { | ||
$table->id(); | ||
$table->string('name'); | ||
$table->string('email'); | ||
$table->text('content'); | ||
$table->timestamps(); | ||
}); | ||
} | ||
}; |
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 | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class() extends Migration | ||
{ | ||
public function up() | ||
{ | ||
Schema::create('users', function (Blueprint $table) { | ||
$table->id(); | ||
$table->string('name'); | ||
$table->string('email')->unique(); | ||
$table->timestamp('email_verified_at')->nullable(); | ||
$table->string('password'); | ||
$table->rememberToken(); | ||
$table->timestamps(); | ||
}); | ||
} | ||
}; |
Oops, something went wrong.