Connect Vue.js and laravel [closed] - html

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
Greeting developers, I am a university student and really new to using frameworks. Currently, i done one project for my intern using laravel framework for back end.
Now i plan to do front end using vuejs framework.May i know how to connect the back end and front end. I see previous question in stack overflow there mention can connect using Rest api. May i know how it can happen.Furthermore, i also want to know which is better front end framework for laravel based back end framework angularjs or vuejs.
<html>Thanks in advance</html>

To "connect" your app to a backend service (whatever Laravel/Express/RoR etc), you have to make HTTP calls to your backend server.
With VueJS, you can use Axios to make HTTP calls.
Example of usage:
axios.get('https://yourbackend.io/users/all').then(users => {
this.users = users;
});
About your last question, there's no "best framework" to use/learn along with any backend technology. However, if you want to see good resources for Laravel and VueJS, you can watch Laracast videos.

Related

Web scraping with Laravel [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 1 year ago.
Improve this question
Welcome, all
I would like to create a small web application, which needs to scrape data from another website and save the results to a database.
So, currently, I have Laravel 8 installed on my local windows machine, and I made a connection to the database, where I have "items" in the table that I need to save the data in
And the data may be changed from another website so I need this change in the database as well,
and need to scrape many items from another website so I need to know id or something else to distinguish one item from another
Now, the question is, what is the best way to do this? I've tried some tutorials but I haven't.
You can use a package Goutte or domcrawler, first you need to do a request of a url for that you can use GuzzleHttp or get the portion of html content and filter it and then save all this data on a table of your database.
You can read more information about those libraries.
Another library that is more customizable is domcrawler Dom_Crawler,
Goutte

connect backend code(nodejs) this with my front end code(angular framework) [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I am a beginner in web development.I am using angular framework ,need to connect with DB using Nodejs. I am able fetch data from db using NodeJs. How to connect this with my front end code
You have a front-end and a backend, note that front-end is not a necessity just a web front-end, it might be a mobile application as well.
Your server should be able to send back data to be helpful for any kind of programming languages in front-end, either it's a mobile app, or a React or Angular application. For this scenario and to solve this problem we can use RESTful API (Application Programming Interface) which simply is a JSON sending back data from the backend, and front-end applications can work with it.
For your case, you should connect to the database using Node.js backend (I recommend you to use a Node.js framework, such as Express, Feathers, Strapi, or etc) and send data back in RESTful API format,
You can fetch data from nodejs using ajax request.
Follwoing link may help you to learn this:
Ajax Request in Angular
from jquery $.ajax to angular $http
You can use mysql module in nodejs for fetching data from your database.
As a newbie, you can do the above steps and then follow some tutorial that teaches how to do all this.

Best practice when building both RESTful API and web application [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 2 years ago.
Improve this question
So i'm developing a project using Laravel 5.7, and I want to include a RESTful API to make the mobile version communicate with the app, and of course the web application itself.
My question is, what is the best practice is such cases when it comes to routing and controllers, I have read some suggestions here and other blogs and got confused, some suggested that I should declare One Routing file to be used by the web app and API and add an identifier for e.g("web" and "mobile") and based on it I return a view or JSON data, others suggested to separate the routing (api and web) but point them to the same controller methods which is think it's better than the first suggestion.
Appreciate your help.
Laravel separates the api routes from the web routes.
Web routes are in the routes/web.php file.
API routes are in the routes/api.php file.
What can be annoying is to separate the logic of the API part from the logic of the web part.
Here the solution is still simple. What I do is I create a folder that I call API in app/Http/Controllers; all the controllers I put in this folder are in the App\Http\Controllers\API namespace. In the corresponding route file, all you need to do is add the API\ flag before the controller name.

is it fine to have normal java class to handle database connection with servlet? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am working on an web application using servlet jsp. now I am planning to write all database activity(queries and prepared statements and their execution) in normal java class and instantiate those class in servlets. just for reusability. could you please suggest me if it's a good approach? I am using : tomcat6, servlet2.5 jsp2,mysql
Yes u can use a separate plain java class to acess database...thats what the MVC architecture is, your java file will behave as model that handles..data and db connectivity, while your Servlet will behave as controller, that calls your business code..which is in a separate reusable java file..
If you are writing a web application accessing a DB, then I suggest that you use some Persistence API, such as JPA or Hibernate. if you are using Eclipse or another IDE, the ability to reverse engineer your Entities from the DB will save you a lot of errors and time.
See http://www.vogella.com/articles/JavaPersistenceAPI/article.html

.Net User Login Program [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
I'm wondering if there exists a pre-build application to handle user logins and permission structure for a .net application.
This would be to manage clients logging in and what data they can see.
Essentially I would like to buy a framework instead of building one ourselves.
Does something like this exists, if so do you either have any examples or suggestions on what to look for?
thanks,
You can use the ASP.net membership & role services outside an ASP.net app.
See: http://blogs.msdn.com/b/msdnts/archive/2006/12/16/asp-net-2-0-membership-role-management-out-of-asp-net-context.aspx
I would develop my own custom membership provider and use the ASP.NET membership service. If your goal is to create a framework for your applications, the effort is suitable.
There is a nice article showing the implementation of a custom provider, even using the new MVC technologies.
http://www.codeproject.com/Articles/165159/Custom-Membership-Providers
There is also a programmers exchange topic about what we are talking abour:
https://softwareengineering.stackexchange.com/questions/104268/what-are-the-disadvantages-of-using-writting-a-net-custom-membership-provider
Let me know any issues that you have.