Aurelia with Laravel Backend

Hi guys!
I’m creating a project with Aurelia, and I want backend with Laravel, I have the backend done, but I dont know How I can integrate with aurelia, someone can help me?
Thanks!

1 Like

If you want to serve your front end from the static directory of your PHP backend, you can either:

  1. Create your front end as a separate app, build it, and copy dist artifacts over to your backend static directory when you’re ready to release. This way you can use any options Aurelia provides to you.
  2. Create your front end directly inside your PHP backend static directory without building anything. It will be very close to a dev experience with jQuery or AngularJS 1.0. You will need to use JavaScript, (not TypeScript), and Aurelia Script. https://github.com/aurelia/script
2 Likes

Thanks for your response !I’m doing separate app, can you say me the options aurelia provides, or the link with information?

1 Like

I’d recommend creating new projects with the official CLI. See https://aurelia.io/docs/cli/

1 Like

I’m doing that since started using Aurelia

1 Like

That’s the options I was talking about (pick Esnext or TypeScript, pick a bundler of choice, optionally add css languages, optionally add postcss processing…)

When you use Aurelia script you are pretty much confined to ES5 JavaScript. Any CSS capabilities depend on your PHP backend, etc.

1 Like

Something else you could do is check out the realworld projects for Laravel and Aurelia for tips on how to create a decoupled architecture: https://github.com/gothinkster/realworld. When done properly you shouldn’t need to ask yourself “how do I use X front-end with Y back-end?”

1 Like