In normal laravel controller I return a view with the data
return view('folder.page', compact('data'))
But I'm building my website with an API to work also in mobile devices, how should I build my html with the API?
- Create a controller that calls the api and return the view with the data
- Build with javascript functions that calls the api and build the html
- Another way
UpdateImportant thing, the API is in the same project, it isn't an external api