Giter Club home page Giter Club logo

Comments (3)

rpereira-tae avatar rpereira-tae commented on September 13, 2024 1

Initially I thought it was missing the @csrf directive in the blade template. But adding or not didn't make any difference.

from filament.

rpereira-tae avatar rpereira-tae commented on September 13, 2024

Not totally sure if it's a bug or something I missed during the configuration. Any suggestion or comment is appreciated 🙏🏻

from filament.

urufudev avatar urufudev commented on September 13, 2024

I remember seeing that error in my log as well, but in my case I was using Livewire. I compared my code to yours and the only differences I could find are that I don't have @csrf in the Blade template and I have ->statePath('data') in the form.

 <form x-data="{ isUploadingFile: false, isSubmitting: @entangle('isSubmitting'), isFinishedRegistration: @entangle('isFinishedRegistration') }" x-on:file-upload-started="isUploadingFile = true"
            x-on:file-upload-finished="isUploadingFile = false" wire:submit="register" class="fi-form grid gap-y-6">


            {{ $this->form }}


            <x-filament::button type="submit" wire:loading.attr="disabled"
                x-bind:disabled="isUploadingFile || isSubmitting || isFinishedRegistration"
                x-bind:class="{ 'enabled:opacity-70 enabled:cursor-wait': isSubmitting || isUploadingFile || isFinishedRegistration }">

                <x-filament::loading-indicator wire:loading wire:target="register" class="h-5 w-5 mr-1" />

                <span x-show="isUploadingFile">Subiendo archivo...</span>
                <span x-show=" isFinishedRegistration || isSubmitting && !isUploadingFile">Enviando...</span>
                <span x-show=" !isFinishedRegistration && !isSubmitting && !isUploadingFile">Solicitar Registro</span>

            </x-filament::button>
        </form>
public function form(Form $form): Form
    {
        return $form
            ->schema([
                $this->getDniFormComponent(),
                $this->getPhoneFormComponent(),
                $this->getEmailFormComponent(),
                $this->getPasswordFormComponent(),
                $this->getPasswordConfirmationFormComponent(),
                $this->getFileFormComponent(),
                Turnstile::make('turnstile')
                    ->size('normal')
                    ->language('es')

            ])
            ->statePath('data');
    }
    
        protected function getFileFormComponent(): FilamentComponent
    {
        return FileUpload::make('file')
            ->acceptedFileTypes(['application/pdf'])
            ->label('Formato de solicitud')
            ->hint(new HtmlString(Blade::render('<x-filament::link :href="asset(\'build/assets/pdf/formato_boletas.pdf\')" target="_blank" icon="heroicon-m-document-arrow-down"> Formato a adjuntar </x-filament::link>')))
            ->helperText('Procura los datos sean legibles para mayor rapidez de tramite.')
            ->directory('request-files')
            ->required();
    }

from filament.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.