jonassiewertsen / statamic-livewire

A Laravel Livewire integration for Statamics antlers engine
83 stars 14 forks source link

Transmitting data with a redirect #29

Closed GuyVervillePerso closed 1 year ago

GuyVervillePerso commented 1 year ago

Hi, First, thank you for your component. It has been of great help. I need help with a function in my component that correctly calculates the Livewire component data. It comes from the form linked to that component. The submitted calculations are as follow:

` public function submit() { $data = $this->validate();
$birthChartService = new BirthChartService(); $results = $birthChartService->calculateBirthChart($this->birthChart); $this->birthChart->birth_json= json_encode($results); $this->birthChart->save(); $this->data = $results[0]; $this->modes = $results[1]; $this->birthChartData = $this->birthChart->toArray();

    return redirect()->route('astrochart'); 
    `

After the form is filled, the calculations proceeded, and I want to redirect to another Statatamic page.

I try to use this in the antlers file:

    `{{ birthChartData.first_name}}`

But to no avail.

I tried dispatching some event since I do not want to pass the data in the URL.

Would you happen to have any idea how to proceed?

jonassiewertsen commented 1 year ago

I am not sure this relates to the addon itself.

I would recommend asking on Discord, as I can't provide general Livewire support here. Sorry about that.