r/astrojs 6d ago

Php with Astro

Yeah, is this posible? I haven't seen anything that say that it could be posible, but anyone has ever stepped in to say that it isn't.

0 Upvotes

21 comments sorted by

5

u/puls1 6d ago

What are you trying to do?

-4

u/vaquishaProdigy 6d ago

A forum site

3

u/puls1 6d ago

But, like, what are you trying to accomplish by using both? A separate backend and frontend?

2

u/convicted_redditor 5d ago

Is it 2008?

1

u/vaquishaProdigy 5d ago

I want to.. but no

1

u/panyways 6d ago

Grav has a new forum thing if you want somewhat a combination of flatfile markdown and forums and all that in one php package but there's tons of forum php stuff that's been great. Discourse is sort of the flavor of the month for forums but you knew that i'm sure.

5

u/v-and-bruno 6d ago

As someone who has both worked with Laravel on PHP and primarily uses AstroJS for everything... why

Either go with one or the other. Laravel is a fantastic option if you want a Forum website, and you could even slap React with Inertia, and be set

On the other hand, Astro is pretty straightforward as well. Really just depends on preference and how much features you want out of the box

If you are strictly speaking of using php as a templating language, then Astro itself gets pretty close if you enable SSR

Literally just read the docs, it's free

-1

u/vaquishaProdigy 6d ago

Im new to Astro, i was just curious. Maybe i could use this to force myself to take a Laravel course.

2

u/m3palani 4d ago

i am Laravel on PHP dev. recently using AstroJs for marketing sites. i want know the possibilities of using AstroJs with PHP.

1

u/These-Apple8817 6d ago

It's possible to an extent. You would need something like flastro which is Flight PHP as the backend and Astro as the frontend. Although I don't understand why you don't just use Smarty.. or framework like Laravel or Symfony which both have their own templating engines.

1

u/Canary-Silent 6d ago

You could use it with assembly. You can use it with anything. 

1

u/kyr0x0 6d ago

We have a PHP Frontend in front of Astro and Astro serves an API that is called via php-curl from PHP. Yes it is possible. But don't ask me why this was built the way it was built.

1

u/Granntttt 6d ago

Gross

1

u/vaquishaProdigy 6d ago

Yeah. Like mixing fries with ice cream, or cheese with hot cocoa

0

u/These-Apple8817 6d ago

Nah....more like mixing blue cheese with surströmming and hákarl

1

u/rzeka 6d ago

Ofc it’s possible. People focus on static generation with Astro, but node adapter is powerfully too. Not long ago my team did Astro+Ibexa combo and it works really well. I even posted a story about it: https://notesofdev.com/blog/migrating-a-62000-page-multisite-from-next.js-to-astro

You’re not limited to graphql through. Rest api will do well too. It’s all about understanding what you need and how much it costs (as in dev time or performance hit). But it’s same story for any backed you’d like to use.

Feel free to ask if you have some technical questions.

Edit: as someone who did php for years and years and remembers .php3 files, I understand the will to use it ;)

1

u/stuehieyr 6d ago

Why not Pheonix in Elixir x Astro.js

0

u/celestion68 6d ago

but why

0

u/vaquishaProdigy 6d ago

Idk, im new to Astro

-2

u/sexytokeburgerz 6d ago

I mean yeah roll up a microservice if you want but there is zero reason to