I've experience with MERN stack but I'm completely new to Laravel, although I've got the basics of php but no oops concepts .... How should I start ? Any resources?
For further actions, you may consider blocking this person and/or reporting abuse
I've experience with MERN stack but I'm completely new to Laravel, although I've got the basics of php but no oops concepts .... How should I start ? Any resources?
For further actions, you may consider blocking this person and/or reporting abuse
MD ARIFUL HAQUE -
MD ARIFUL HAQUE -
Harshvardhan -
MD ARIFUL HAQUE -
Top comments (8)
In Laravel, you should learn these important concepts. It's a huge framework with lots of options so please don't try to learn everything at once:
MVC essentially.
In Laravel, when a request comes in - the routes file is checked, if a pattern is matched. E.g.:
You visit: "/welcome", it now matches the above "GET" route (Laravel respects REST verbs GET, POST, etc...). The second argument to this function is which class must handle this request i.e. "WelcomeController" and then which method in this class must handle this request i.e. "index".
In your terminal, if you run this artisan command, it will print out all the routes you have configured:
The index method then needs to return a view. It can do any processing before returning the view like getting data from the database.
Here is a basic controller:
A model in Laravel looks like this:
Laravel will automatically look for a table named "categories" in your database.
You can then query for data:
To build an API, Laravel provides "routes/api.php" which is very similar to the "web.php" routes file. The only difference is that your controller method needs to return JSON. Learn more about how to return JSON and other response types here:
laravel.com/docs/10.x/responses
I also advise: laracasts.com/ and reading the Laravel documentation in more detail, at least the getting started part.
Hope that helps.
First of all, you need a full-stack PHP environment. LOL
Don't you think so?
Yeah I do ;)
If you on Mac: herd.laravel.com/
For Linux and Windows: apachefriends.org/
If you want to deploy to a server, I built an open source tool for that: plexscriptables.com/
On Linux you can also just install PHP locally:
Then in your Laravel project:
Edit your .env and set your DB as follows:
The documents are the best teachers.
laravel.com/
It depends what you want to achieve? If you are looking more for integrating with APIs or building APIs yourself.
Each one I can give different advice, so let me know!
Building APIs
I have loads of resources on this, but I can also give any advise you may be struggling with?