Answer the question
In order to leave comments, you need to log in
Laravel, what's the best way to embed some API with AJAX in a small (Non-SPA) site?
There is a small educational project - an online store. The site is rendered completely on the server, but I want to do a couple of things through AJAX (Uploading products to the store and adding the user to the cart, for example).
Is it worth it to use Laravel passport, tokens and all this for this (As I understand it, with the help of these tools authorization for the API is implemented), take out routes in api.ph
Is it possible to simply add a couple of routes (post and put) to web.php and use ready-made middleware (auth to add to cart, admin_priveleges to add products)? Or is this approach unacceptable?
Answer the question
In order to leave comments, you need to log in
Or is this approach unacceptable?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question