Porting Livewire project to Alpine JS Project

Hi.
I finished a project using livewire.

But under some condition Livewire is not good choice ( ex, when Https / Http should be running together…, cloudflare flexible https … ) .

So I want to use Alpine JS instead of livewire.

Yes I totally understand those are different things.

But as I know there is Alpinejs module used inside Livewire.

Are there any tips for porting projects from Livewire to Alpine JS ?

There is no porting. It will be a complete rewrite, and probably not using Alpine because you will need to use native ajax functionality (axios).

How are your Javascript skills?

I don’t understand your comments about being not a good choice? what is this opinion based on ?

1 Like

Can you explain those conditions when Livewire is not a good choice and why?
And what are you doing exactly?

Sorry for being late.

It might not be about livewire or yes maybe.

for example, if my domain ( domain.com ) is being serviced though Cloudflare . there is 4 options for ssl .

there is second option , it is called flexible SSL .

Flexible SSL means this.

User -> Cloudflare Dns Servers : https
Cloudflare Dns Server -> My Server : http .,.

so I dont have to issue and setup SSL certificate and keys on server .

Thats is pretty much comfortable for me.

But If I use Flexible SSL connection, Livewire does not works.

I don’t have much knowledges deep inside Livewire and know how to fix this …

Any comments will be appreciated.

Thanks for comments.

My JS skill is not poor, I guess.

Actually I have some expriences with Vuejs ( 2.x ), and there is some projects I have done with Laravel + vue.js ( not SPA )

But Vuejs is pretty much painful for mixing with another js library… like Alpine Js ( shadow DOM vs. Real DOM )…

So I want to build new project with Laravel +_ AlpineJS only. ( I can not use Livewire this time…)

And I wish I can adopt the simplicity of Livewire cause Livewire and AlpineJS is a pair, I guess.

My system is under this… (repeating )

for example, if my domain is being serviced though Cloudflare . there is 4 options for ssl .

there is second option , it is called flexible SSL .

Flexible SSL means this.

User -> Cloudflare Dns Servers : https
Cloudflare Dns Server -> My Server : http .,.

so I dont have to issue and setup SSL certificate and keys on server .
./…

Thanks for any comments.

My confusion is why Livewire and Cloudflare is an issue? I’ve never heard of this.

The endpoints called by the livewire client scripts should behave no differently to axios

You should lookup trusted proxies

Probably…

I will check again … but it was true that there was trouble in mixing with livewire / jquery / vuejs and flexible SSL .

So I gave up flexible SSL connection.

Anyway thanks… I will check Trusted Proxies.

Also check that your APP_URL correctly reflects the outside protocol, eg https://mysite.com

It’s Ok @bingglex,
as @Snapey Said What’s the issue between Cloudflare and Livewire Exactly, Can you at least show us the issue or the error (in the console, laravel logs …etc)?

https://laravel.com/docs/8.x/requests#configuring-trusted-proxies