If you don’t like working slightly against the current and learning PHP (v7 is wonderful), then Jeffrey Way’s Laracasts is an incredible resource for full stack development using Laravel and Vuejs. Even as I’ve become quite competent, I still find myself going back frequently to soak up whatever knowledge Jeffrey feels he needs to pass on.
Remember: There really aren’t any bad languages anymore, just bad programmers. PHP is very forgiving for newcomers so don’t feel like you’re learning a bad language or that just because you aren’t on the Node bandwagon, that you are learning an inferior language. PHP still powers the majority of the internet and will for a long time to come.
Here's some resources:
Learn modern practices, tools like composer, and dive into a framework either Symfony or Laravel. And the best (paid) IDE is PHPStorm.
As a long-time user of Laravel, the best advice I can offer is Laracast's 'From Scratch' series on the version you're using. Each one is completely free, and you can find the current version (Laravel 8's) here: https://laracasts.com/series/laravel-8-from-scratch
I will admit, as far as PHP frameworks go each one is overwhelming at first. But having worked in Yii, Laravel, Symfony, CakePHP, WordPress, and CodeIgnitor, once you start picking things up, building an application that works well becomes incredibly fast with Laravel. The biggest thing though is that the framework does rely on a lot of 'magic' and a method of thinking for how to do things the 'Laravel Way'.
I wish you the best of luck in your journey!
PHPStorm and watch this free Laracast: Be awesome in PHPStorm
You have to learn (take your time) to use source versioning (Git).
If you're a student, PHPStorm and most of Jetbrains tools are free: https://www.jetbrains.com/student/
I completely agree.
The Laravel framework is definitely the way to go. It has some tremendous things going for it.
I could go on for a while, but I'd recommend you dive in. It fucking amazing.
Laracasts.com has two free courses that would be beneficial to you:
1 is PHP for beginners. Now before you get insulted, it's not because I think you're a beginner but because it might help you fill in the gaps in your knowledge. It'll take you through everything including intro to OOP, MVC pattern, composer/autoloading, etc.
https://laracasts.com/series/php-for-beginners
2 is the follow up course here which is Laravel 8 from scratch. This will walk you through a pretty broad overview of laravel and how it can help you solve problems with laravel. By the time you through maybe a third of this tutorial, you should have a pretty good grasp on whether or not laravel is right for you.
The learning curve for Vue is a lot less steep than React or Angular in my opinion. I'm biased because I use Vue a lot now, but it took me less than a week to get comfortable with Vue+Vuex. I tried Angular a lot before and it never felt anything like as natural or enjoyable as Vue. I think React is great but I don't find it as fun (personal preference).
Since the start of 2017 I've almost finished two Vue SPAs and have started on a third. That's alongside building APIs for each using Laravel/Processwire as the only dev at my company. All use Vuex and have SSR. It haven't felt this efficient on the front end in a long time, so I would really recommend it. If you'd like some links to the resources I used when I started out I'd be happy to share.
EDIT: Both of these have already been mentioned but I'd really recommend this Udemy course. It's currently listed at £190 for me, but I bought it for £11 during a promotion. Udemy is strange, often courses drop to under 1/10th of the price seemingly randomly. Either way it's certainly worth a lot more than £11. It's a little slow at times but certainly the most comprehensive Vue tutorial I've found. As people have mentioned, the Laracasts series is currently free and a pretty solid introduction.
For the first experience, Laracasts have good videos with TDD https://laracasts.com/series/build-a-laravel-app-with-tdd you can try. I'm not big fun of Laravel but to understand this approach this videos is good.
Have fun with Laravel ! Community is big and they are a few resources out there to start !
Checkout https://laracasts.com/ Jeffrey is a very good teacher to set the basis
That is probably https://laracasts.com/.
Besides that, there are some great projects on Github, which you might look into.
And this is a great resource for information regarding Laravel in general: https://github.com/chiraggude/awesome-laravel
Just noticed Jeffrey Way made "Laravel 5 Fundamentals" free today. It wasn't yesterday. Kudos, Jeffrey. :)
https://laracasts.com/series/laravel-5-fundamentals
Dayle Rees, where is "Code Smart?" :P You're losing ground to Mr. Way!
The series currently sits at over 4 hours of FREE Laravel 5 video training from one of the best teachers out there. That is truly amazing. I'm not a paid shill or even a friend of Jeffrey, I just recognize a kick ass bargain.
I do sortof wonder if Way is earning more off of the existence of Laravel than Mr. Otwell himself. They should really form a company together and share. :)
Drop the Python (for now) and pick PHP back up with Laravel and a Laracasts subscription. Laracasts will teach you everything you need to know for modern web development. Once you have a hang for modern web dev, then feel free to go back to Python. There is nothing wrong with Python, but it doesn't have the learning resources that PHP currently has. Laracasts is amazing.
I've been using Laravel for quite a while and it has become my goto for almost everything. It comes shipped with just enough tools to get you started. It's beautiful Eloquent ORM makes database grepping EASY. For example. Do you want the latest Posts that are active and want the first five?
>$posts = Post::where('active', true)->latest()->take(5)->get()
Laravel can do scheduling, event queues, delegation, beautiful emails, and a truckload more. And the tutorials? Laravel has an unwritten tutorials master called Jeffrey Way over at Laracasts where you will learn _EVERYTHING_ you need to know about Laravel.
And one thing I like about Laravel and its creator: Taylor, is that he _values_ consistency and elegant, readable code. He'll scan Laravel source code to make it sure looks _just_ right.
Lastly, Laravel has an ecosystem of tools to help you along its process. Want Laravel but for micro-framework APIs? There's Lumen. Want to implement Billing? Laravel Cashier. Want to deploy? Envoyer. Want to spin up servers? Forge?
If I were you, I would highly recommend Laravel. The documentation is superb. The tutorials are amazing and Jeffrey Way is a great guy. Unit testing is easy. And the functionality and use out of the box with Laravel is insane.
Go for it. Give it a spin. Start here: https://laracasts.com/series/laravel-from-scratch-2017
Yes it;'s from 2017 but not much core or fundamentally has changed. We're on 5.6 and each version (5.4, 5.5, 5.6) has brought new featutes to help Laravel carry itself along.
/u/jeffreyway did an awesome set of PHPStorm intro videos which cover everything from decluttering, to theming, to keyboard shortcuts, to templates/macros... it's basically my goto for "tips". And it's one of his Free series...https://laracasts.com/series/how-to-be-awesome-in-phpstorm.
I use probably... 70 or 80% of what he mentions in there.
Also the plugin ecosystem is a bit of a goldmine if you're happy to wade through it to find stuff. The Emberjs plugin is great if you use Ember, the Doctrine Annotations is a must have if you are using annotations, and the .editorconfig plugin saves configuring code styles at a project level (just reads the editorconfig file and applies them).
This is almost a direct copy of Laracasts "Incremental APIs" series. It even uses 100% same code in the first half of the tutorial.
I am okay if you learned it that way by watching that exact tutorial and want to give back to the community now but at least give some credit to the original author if you are copying him.
It's one thing to learn PHP. The language itself is pretty straightforward.
It's another thing entirely to learn how to program. There are many techniques and which ones you can leverage will depends on the capabilities of the language itself.
In recent years, PHP has morphed into a half decent programming language, and as such the community is finally coming around to using more elaborate object-oriented programming techniques, test-driven development, and SOLID coding principles.
Laracasts is a good place to start. There's a free series about starting from scratch with the Laravel framework: https://laracasts.com/series/laravel-from-scratch
Although this series is tailored to beginners learning Laravel, it makes no assumption about your skills aside from understanding PHP itself. Jeffrey takes the time to explain the programming concepts at play - especially ones that may not already be familiar to PHP developers.
Even if you never use Laravel, I think this series is useful as it starts to expose you to good practice architecture decisions.
Absolutely this. First year I started my career I swore by sublime. And I wasn't that type of dude who said that uses sublime just cause I downloaded it and ran it. No sir, I had it configured and tuned exactly as I wanted, with all them nice packages and plugins and all that jazz, and I just flew between classes and methods like no other.
But then I saw my boss using phpstorm. I think it was version.. 5? Anyway, I very quickly realised the importance of having some features of phpstorm that were unthinkable in something as sublime.
I started trying to pick the best of both worlds. What did I miss in phpstorm that sublime had to offer? Well, turns out, I very well could configure that in phpstorm. Make an effort and really try to see what you like about sublime. The speed you say? Not really a strong argument In 2020, in my opinion. Ask for better hardware. The light-weight interface? You can very well tune that. Have a look at https://laracasts.com/series/how-to-be-awesome-in-phpstorm
I'm seeing this as a post where you're trying to not change, but fail to come up with strong arguments, so you're trying to find the right echo chamber on the Internet to support you.
Put on your big boy pants and accept that in this industry you're always gonna have to be learning new things, new tools, adapting, and give phpstorm a good try.
At this moment, I'd have all my team use phpstorm no questions asked.
i'm using this as the fundamental resource
https://laracasts.com/series/laravel-from-scratch-2017
try to code along, not just watching Jeffrey explanation while coding
Laracasts is going to be the most widely recommended site to learn Laravel from. Jeffrey's series on Laravel 5.4 From Scratch is free and is what I would recommend starting off with. Even though the latest version of Laravel is 5.6, this series is still incredibly relevant and everything that he teaches in it can be used in the latest version of Laravel.
You put the development files in /resources/assets/
, and then your build process puts them in public/css
.
That way, you can use uncompressed, commented, easy to read Stylus/Sass files in development, then convert them to compressed, minified files in production.
Use Elixir to do that, there's a video here: https://laracasts.com/series/laravel-5-from-scratch/episodes/6
Check out the basic and intermediate task tutorial: https://laravel.com/docs/5.2/quickstart
Need more hand holding? Get a subscription for Laracasts: https://laracasts.com (You won't regret it!)
Want an overview of the Laravel ecosystem ? Check out https://github.com/chiraggude/awesome-laravel (I'm the maintainer)
Damn I am jelly, all companies near me use vanilla PHP and jQuery. I would absolutely love to use Vue and Laravel and React and other modern frameworks.
These are the best resources:
Since you're already a programmer, I think it's fine to learn what you need about php as you're working with laravel. Take a look at this php series. It looks like it will give you a good primer in a couple of hours. https://laracasts.com/series/php-for-beginners
I haven't gone through it but if it's like the rest of laracasts, it should be awesome.
https://laracasts.com My go to when first looking for video tutorials related to Laravel. My advice would be to look at some of the free videos on the site and compare them to others, to see if it fits your needs, before buying a licence.
Laracasts is very good, you can try some of the free courses to see how you like it. Here is the php route of courses. Just skip over the Laravel based lessons if they aren't of interest to you.
The low barrier entry of PHP (leading to bad tutorials, poorly developed insecure modules/frameworks) + a lot of lingering hate from the PHP4 days has left PHP with a bad reputation.
I urge you to take some time to watch a few intro videos on laracasts, such as the laravel 5.2 from scratch series (https://laracasts.com/series/laravel-5-from-scratch/)
Learn 5.
Best starting point would be Jeffrey Way's aforementioned Laracasts, in particular "Laravel 5 Fundamentals" followed by "Build Your Own App".
I use PHP Storm. They just added blade support, which should make it even better.
http://blog.jetbrains.com/phpstorm/2014/08/phpstorm-8-eap-138-1505/
Jeffrey Way did some great videos w/ tips tricks here: https://laracasts.com/series/how-to-be-awesome-in-phpstorm
I once watched the awesome Laracast PHP Practitionner video tutorial serie, which will not only give you the main basis of PHP developpement, but also some of the insights on how is a router really doing by creating one from scratch, etc... And I like this serie because when you will complete it, it is an awesome introduction to the Laravel serie because you will have the weapons to understand what is an ORM, a router, an HttpRequest, ... Without having to buy the fancy $30.00 "all the design pattern in PHP" book and leaving with a fuzzy head and no practical application.
I really recommend it, mostly with your background.
To be honest, I think there is some fundamental things that you need to understand about how a modern framework abstracts the idea of including different scripts based on a URL. I highly suggest you take a look at the free tutorial series on how to use Laravel, over at laracasts. https://laracasts.com/series/laravel-5-fundamentals
If you're serious about sticking with Laravel, I highly recommend Laracasts. Also, check out the IRC. Plenty of people there willing to help you out. Hell, I mostly just lurk on the IRC and I've picked up a few things off just that.
Lastly, if it makes you feel any better, the first blog project I tried to make took me months to make and it was still a piece of shit. And that's not counting the full month of multiple massive failures at trying to roll LAMP stacks manually, through Vagrant and PHPuppet, and finally through Vagrant and some passable bash scripts which I still need to work on again soon.
Just keep at it. Pain today, laughter tomorrow.
As some have said, you really don't need to use a framework for anything that isn't a medium/large application. But if you fall into that use case, you will find that they can be very beneficial by taking care of a lot of things for you that would otherwise become really grindy and turn into hard to read/maintain code. For a firrst approach at a js framework, I highly suggest you watch Jeffrey Way's Vue 2 series which is entirely free and is very easy to follow for people who aren't familiar with frameworks. That's how I learned. And even if you don't plan on watching it to learn Vue, if you'd rather learn React, I think you may still understand some of the concepts better, as a lot of them are shared between both of these frameworks.
Laravel already has s3 covered. You just put your s3 info into the config file, install the package, and use their save functions.
https://laravel.com/docs/5.3/filesystem
https://laracasts.com/series/whats-new-in-laravel-5-3/episodes/12
I'm still well on my way to being full stack, but here's what I've learned.
I started in a startup making small business WordPress sites for clients. Usually we just took existing themes and tweaked them a bit to fit the clients needs. I didn't know anything past the WP theme editor and FTP. Soon I began to learn how to build themes from scratch using underscores and learned better CSS techniques. I was still using Windows however I found Sublime Text and it became my main editor of choice. Eventually I found tutorials on Gulp and learned how to code with SASS and automatically minify my CSS. From here I took an interest in Linux and installed Ubuntu. I picked up some basic Git and used that on my WP Theme files, we slowly began to get bigger and bigger projects since I could now do things like responsive design and other cool stuff. I distro hopped from Ubuntu to XUbuntu to Linux Mint to Manjaro, back to XUbuntu and finally rested on Arch. I began to notice that WordPress wasn't the center of the earth and branched out a little to learn programming design and began watching Laracasts videos for learning Laravel. Laravel is now my go to choice for nearly every project except for small business stuff which is handled better with WordPress.
If I could give advice it would be this:
I'm not at all an experienced developer, but I've found the laracasts videos amazing for showing exactly how useful a framework can be. Jeffery Way is awesome at keeping the videos concise and interesting and his workflow makes sense.
Try checking out his free laravel 5 fundamentals video series, or at least the first 3 videos (about 10 minutes each) just to see if it's a good fit for you. I found it to be an awesome end-to-end introduction to the framework and it showed me a ton of really, really useful stuff.
The whole series is only 2 hours in total, so by watching one 10-minute video a day you could get through the whole thing in a couple weeks.
Also laravel's homestead thing (which the videos explain) sets up a dev environment and configuration completely for you with all dependencies satisfied. It makes things insanely easy!
jetbrains php storm is the best ide for php projects (opinion :) and has a lot of first-class support for wordpress. It's free if you're a student and ~$100 otherwise (well worth it) but you can also do a trial or download the beta copy. I've used it to develop themes and it offers a lot of really useful stuff (like autocompleting wp functions and auto indenting based on wp formatting styles). Be Awesome in PHPStorm is a good intro to some of PHP storm's features.
https://laracasts.com/series/laravel-5-fundamentals
just to say that laracasts is an excellent resource. SOOO much stuff on there, and its all pushing you towards good SOLID practices.
Its changed my opinion on coding drastically for the better.
Worth the subscription. And the front-end stuff he is doing at the moment is great.
Currently we use the migration system provided with Laravel.
The idea is that every time you make a change to the database, you create an up and down version of what you plan to achieve in Laravel's schema builder. These migrations are then run sequentially in either direction in order to achieve the correct version of your database.
As usual with all things Laravel, Jeffrey Way has a handy primer video
For our previous system we used SQL files denoting which version of the product was currently in development. For example, the site is in version 1.1, and we are currently working on version 1.2. There is a Dropbox file called 1.2_changes.sql which we update whenever we update the schema, putting in a comment on what we're doing and when, and the SQL required to perform the operation. We would also keep a note of when we last performed the changes so as to know where we were in the process. This is much messier than Laravel migrations, but it got the job done.
I really think you do not yet understand the basic of Laravel routing / view handling...
You might first want to try out some basic tutorials about creating routes and views.
Also if you are really serious about learning Laravel you could subscribe to https://laracasts.com to get some really good tutorial vids.
Laracasts, as always, are a great place to start. https://laracasts.com/series/build-a-laravel-app-with-tdd
Couple that with the Testing section of the Laravel docs, as well as information surrounding Laravel Dusk (which allows for actual browser-based testing, not just API testing), and you'll have all the tools you need to wrap your project(s) with decent tests.
Beyond that, you just have to intuit what's needed, where, etc.
Laravel a PHP framework use something similar in the doc where each comment is 3 lines long, and each line is 3 characters less than the previous line.
I would highly recommend Jeffrey Way’s “Laracasts” series for beginners: https://laracasts.com/series/php-for-beginners
He is a fantastic teacher, and this particular series is free to watch.
Best of luck!
You need to stop posting these. Learn about modern design patterns and best practices before making any new videos. No one should be encouraged to write code like this.
http://www.phptherightway.com, http://knpuniversity.com, and https://laracasts.com are all great free or low cost resources to get you started.
Please take this advice to heart and don't just reply with LOL like you've done before
My opinion: the "catch-all" sites, that try and offer courses on any and everything tech, are not your best bet. The courses and instructors vary way, way too much in quality to make it reliably worth it.
What I recommend instead is subscribing to tutorial micro-services, where each site focuses around one particular topic.
The benefit of this is that they are usually taught by someone who is a true veteran of that particular language/framework/paradigm, the quality is consistent across the board, and you get taught a consistent style instead of piecing together how ten different instructors structure their projects.
Some of my personal favorites:
Be sure you're learning the right way to write PHP, take a look at these two resources which I've found helpful!
http://www.phptherightway.com/
https://laracasts.com/series/object-oriented-bootcamp-in-php
You're not alone in this view. Angular has been long dominant, but is in a bit of a fuzzy state at the moment, with people unwilling to commit to the "old" Angular for a new project, and unwilling to move to the unknown of Angular 2.0.
Personally, I've never been a fan of Angular, but I think this is a good time to take a look at what the other options in the ecosystem now are. And there sure are plenty.
One is React. React is from Facebook, and is best known for being super-fast at rendering. This makes it great at small things that routinely change, such as admin panels or live data. In MVC framework terms, React is not a very comprehensive solution. That's not a criticism, it's by design. It is considered to be the V in an MVC framework, not a full framework. There are a lot of things I don't like about React. It's oddly undisciplined, with evangelists touting its lack of templating and tendency to return raw HTML* directly from functions like it's a feature.
Vue.js is another newcomer. It's more like Angular than anything else, which puts me off right from the start. It's sort of promoted as "angular for normal people", in terms of being some sort of highly pragmatic and practical framework. Jeffrey Way has a really good tutorial on Vue.JS on his Laracasts site. I don't think these are free videos, but they're worth $9, they're an excellent resource.
My own preference is EmberJS. Ember is not talked about a lot on Reddit. It tends to be used in very large applications. It is (by far) the most frameworky javascript MVC framework. It's related quite closely to Rails (shares some core devs) and has a very familiar feel architecturally to backend frameworks like Rails or Laravel. It's hard to learn - harder than most or all JS frameworks. But IMO it's a serious contender for larger applications. Apple Music, for example, was written in Ember.
* I know it's not actually raw HTML, but it bugs me.
Do you have basic knowledge of OOP programing? Do you have any experience in MVC frameworks?
Myself personally never really liked Lynda for development training. If you are wanting to do Laravel I would suggest learning 5, as 5.1 will be similar and have an LTS Release soon.
https://laracasts.com/series/laravel-5-fundamentals
Is FREE for everyone I would say watch that and if you enjoy it subscribe to Laracasts and watch all the other great videos!
> 1) De ce sunt programatorii PHP cei pe seama carora se glumeste cel mai mult? Am vazut pe mai multe forumuri asta, inclusiv forumuri straine.
Pentru ca multi inca au senzatia ca suntem in 2005. Hahah, hai sa radem de developerii PHP pentru ca acum 10 ani PHP 4 a fost de porc.
>2) Cat de des folosesti matematica invatata (de la analiza si algebra abstracta in sus, nu ma refer la matematica de baza) in practica?
Deloc.
>4) Windows sau Linux pe computerul de acasa? De ce?
Windows pe laptop si ubuntu pe desktop. De ce? Pentru ca am avut probleme cu wifi-ul si vroiam sa ma joc.
6) Ce carti din domeniu citesti in timpul liber?
Gang of four, Patterns in enterprise software sunt tari. Ce-i drept, n-am avut timp sa le termin.
>5) Gasesc foarte dificil lucrul in echipa si intelegerea unui cod scris de altcineva. Ai intampinat problema asta? Daca da, cum ai trecut de ea?
Depinde de cod, docblock-urile ajuta, daca e scris prost e si normal. Spune-i sa-si comenteze codul, sa-l faca cat mai simplu. Daca tot intrebai de PHP, uita-te peste video-ul asta: https://laracasts.com/series/simple-rules-for-simpler-code/episodes/3
Mi-e lene sa-ti raspund la toate intrebarile.
If you want to learn the wrong way to code quickly, look into Wordpress. Don't get me wrong, it works and it's easy to pick up, but it's really dated and it doesn't really use any of the latest and greatest techniques.
If you want to learn PHP, I'd suggest looking into Laravel. It's an awesome framework and there are many resources for learning it. The community is great, too.
In fact, you can watch a beginning series of videos for free at Laracasts.
https://laracasts.com can definitely help you there. If you already know the concepts you're really just learning how to do it in that particular framework which is achievable within a week or so.
Have a look at these links
Framework https://laravel-tenancy.com/
Talk from Laracon https://multitenantlaravel.com/
Multiple Domains https://laracasts.com/discuss/channels/general-discussion/multiple-websites-built-on-one-laravel-framework?page=1
I'd love to read a good article about spark multi-tennancy, so if you find one, let me know!
I am never going back to Gulp after trying Webpack. The configuration is confusing at first, I don't disagree. But their official documentation is fantastic, and I highly recommend watching this series if you're still confused. It's a fantastic intro to Webpack
Laracasts has an entire series on stripe payments. Check it out if you have not already.
Laracasts is definitely your best option.
Here's a recent series that walks through most of the basic functions and builds a website from scratch.
Matt Stauffer's blog also does a great job on coming up with examples and explaining new features of the latest releases.
Laravel is a great framework to start with for beginners as it really makes some of the more complex nuances of development easier to get a hang of while providing you with best practices to work with.
I would suggest starting with https://laracasts.com/series/laravel-5-fundamentals and looking at building something small with it. The series is free on Laracasts so theirs no reason not to give it a try.
Im in the process of redoing my businesses marketing website in Laravel from WordPress. We use WordPress largely for client work but Im beginning to feel the additional flexibility of Laravel would be a good addition to the tool set.
As a new Laraveler myself it is very confusing change. the paradigm is completely different to what I was expecting. however it is a well thought out framework.
As I am new I cannot give you many pointers except where I failed to pay attention while learning myself.
Firstly go here to laracasts and watch this video it was HUGELY informative I mean without it I would have floundered badly.
https://laracasts.com/series/laravel-6-from-scratch
[edit]The video is two versions old now as laravel moves quickly however its a great way to learn the basics and is current enough to get you on the right track.
Then look into webpack and mix.js its mentioned in the video above but not enough to pique your attention as you are still trying to learn the basics.
And have fun. its a great framework to learn.
Check out creating your own custom Laravel presets. They will do sheet you need.
Edit: Here's some resources on how to do it
https://laracasts.com/series/how-to-create-custom-presets
https://austencam.com/pages/creating-a-custom-laravel-preset.html
You can do this with Events and Observers. When an event is being called (ex User liked their post) you can send a notification. I learned this here. There is also a great documentation on this available at the Laravel website.
You can definitely learn both at the same time, especially since you already have programming experience. One issue you might run into is having trouble differentiating what is a Laravel feature and what is a PHP feature. I've worked with people in the past who learned PHP with one framework and struggle to work on PHP projects that aren't written in that specific framework.
Like the other commenter mentioned Laracasts is a great resource, especially if you like learning from videos. The PHP Practitioner series would be a great place to start. The first few episodes might be too easy since they cover general programming concepts, but you can watch at 2x speed, or just skip the obvious ones.
It's the easiest PHP framework to pick up and has great documentation.
Routing - Check
Controller Auth - Check
Models - Check
ORM - Check
Front end agnostic - Check
Also as a bonus, here is an entirely free course if you need it: https://laracasts.com/series/laravel-from-scratch-2017
What you're doing is called the "service locator" pattern. It means you're using a class to locate other services from within other classes. Eg. from a controller. "Dependency Injection" (DI) means you won't lookup those dependencies, but instead inject them into the places you need. Eg. if BlogController
requires a BlogModel
in all of its actions, it means the BlogController
shouldn't be allowed to exist without it. Than you could inject the model via the BlogController
s constructor. If it would be an optional dependency, you could use a setter instead.
But where does that constructor call come from? As far as I know DI can only work to its full extent when all classes who need injection are registered as a service into the container. This container knows how to construct each class because you've either specified the definitions, or use a lot of magic in PHP.
Because this explanation might not suffice, you probably want to take a look at this laracasts video to understand how DI can be done: https://laracasts.com/series/laravel-from-scratch-2017/episodes/24
For Laravel you can also check out https://laracasts.com/skills/laravel.
I know... one more site to watch stuff on... but Jeffrey's videos are just really well made and the basics are completely free even without registration.
Absolutely, so many benefits in fact I don't really know where to start. Take a look at the free https://laracasts.com/series/laravel-5-from-scratch and just look at how easy everything is, and how simple the code you end up write is.
I'm not a salesman by any means, but the PHP community widely regards CodeIgniter as not fit for purpose any more in this day and age, so I highly recommend you take some time to learn a modern framework - Laravel is popular and a good choice because its so easy to learn and see results very quickly.
Laravel 5.3 is just out. I wouldn't expect a vue tutorial for that specifically for a while. The laracasts are super handy. (I know you mentioned them).
Honestly your best bet is to get the basics from these lessons and then challenge yourself with some example you want to build.
Laraval is great as ever!
Personally I won't be using Foundation. It feels cluttered and the latest release contained quite some bugs.
Haven't been reading a lot about Bootstrap 4 either, but 3 still works great for me.
Angular 2 is quite.. controversial. Lot's of people have written about Angular 2, definitely read some of those. (For example this one. It's a bit outdated, so things might have changed!)
I would recommend to read a bit about Vue.js. It's very lightweight and doesn't have the crazy syntax Angular has. It works perfect with Laravel and a lot of extensions have been written for it. For example, Laracasts has a great tutorial on Vue
For learning laravel I recommend using the video's on laracasts.com
I used that website myself when using it for the first time and the videos really helped me understanding things as I was very overwhelmed at the beginning
EDIT: I recommend starting here https://laracasts.com/skills/laravel
This is indeed a pretty big indication that your user model is getting too many responsibilities. There is no real way to define a relation from the outside though; Laravel uses the magic __get() overflow method to check if the unknown property you tried to access exists as a relation method. This is how it is able to know that when you call:
dd($user->logs);
That it should check if there is a function called logs that returns a relation. This means that no matter what, the logs function will have to be available on your user model, otherwise the relation attribute won't work.
What you'll want to do instead is split the responsibilities over a couple of traits. You can see an example of it in Laravel itself, if you check the base controller provided in app/Http/Controllers/Controller.php. The base controller has no actual code; it simply uses the DispatchesCommands and ValidatesRequests traits. All functionality is contained within those two traits. It's no longer the responsibility of the base controller, but the base controller still contains the functionality by using the traits.
I'd suggest having a look at the Laracasts series for Solid design principles in PHP, it's quite an abstract level of OOP, so it might be rather difficult to grasp, but once you get the hang of it you'll end up with cleaner code, and less to no bloat in your models. If Laracasts isn't your thing, you can just google for SOLID principles in PHP, you'll probably find some tutorials / guides on it as well.
https://laracasts.com/series/laravel-5-fundamentals
These videos are free and walk you through getting started with Laravel 5. Laracasts (run by Jeffrey Way) is pretty much the ultimate source for Laravel and PHP. If you decide to continue learning PHP and Laravel, I suggest you subscribe. Well worth it IMHO.
Nope, that's perfectly fine. There is nothing wrong with using jQuery if you just have to manipulate a couple of DOM elements and provide some simple interactive functionality.
As you said, once you get into pages that are meant to behave more like native apps, you have to use a library / framework and actually organize your JS appropriately.
Using jQuery to do complex or lots of DOM manipulation leads to what I call the jQuery Jungle, which is a convoluted mess of very imperative, "procedural" code that quickly becomes hard to maintain.
Frameworks and libraries let you organize your code more easily, and inherently make your code more declarative, which makes it easier to reason about and understand.
That said, even for certain simple things, a library like Vue can actually make your life easier than jQuery.
This is a free Laracasts series that gives you a quick intro to Vue. Might be worth your time to watch the videos to get a sense of how Vue works, how it differs from jQuery, and how powerful / useful it can be.
Check out the color IDE plugin. It applies the colors to the sidebar, and some other places, Which I think might be what you mean by the colors not getting applied.
Here's a video about it.
Minor updates shouldn't have it's own posts.
But if anyone is interested in learning Vue I recommend checking out the free course at laracast: https://laracasts.com/series/learning-vue-step-by-step/episodes/1
I'm personally a fan of PHPStorm for mid-size to large projects. You can always run the trial and see if you like it, I suggest going through this free series from Laracasts for getting it all set up as well as getting a bit of a walkthrough on it. Obviously you can skip sections you don't care about but it's a pretty solid set of videos to get you going.
Why don't you start with https://laracasts.com ? It'll teach you the basics of all the stuff you mentioned.
Jeffrey Way is an excellent explainer/teacher and there is are a lot of freebie content. I'd recomment pay the $90 all-access for a year (or $9 for a month) though. Worth every penny.
Disclaimer: not affiliated in any way to laracasts. Just a happy customer.
I would use vim if I could get it to look and function like the guy who runs https://laracasts.com/ can.
It's too much work to do all that. I wish there was a good pre-made installation with a good .vimrc and a bunch of plugins
https://vueschool.io have some good free videos / courses (plenty of beginner stuff).
For Laravel & Vue together https://laracasts.com have some stuff on this and Andrea Madarang https://youtube.com/c/drehimself also often posts videos using the two together.
Take a look at Laracasts. They give a great introduction to those core concepts and how they should be used.
Keep in mind, it's not very common for a dev (especially entry-level) to know everything that ships with Laravel. In reality, most of the things that exist in Laravel are there because they make something easier or better in some way. Eloquent simplifies relational databases, Collections simplify array manipulation, etc. A lot of the things you'll only learn about because you really needed to. You'll ask yourself, "is there an easier way to do ____," and virtually always the answer is yes.
Take Events and Listeners for example. Say you build this wonderful app, but your alpha testers tell you that they wish they had notifications when things happen inside the app. They give you a list of all the actions they want to be notified about- so you go in to each of the controllers and add the notification generation.
Then you realize, the notifications don't have labels and there's nothing differentiating the read from the unread.
After you make your migration to update the schema, you've now got a dozen or more Controllers to sift through to update how those Notifications are generated. What if you forget one? Why are you doing Notification generation in so many places? Argh!
Had you written an Event to fire for each of those actions, you could put all of your Notification generation methods in a single Subscriber class that is cleanly separated from the actions that generate them. All of the Notification-generating code is in a single place, easy for updates and maintenance. Your functionality grows while your controller methods stay lean and clean.
If you'd like any additional advice or want me to review anything you've worked on, feel free to PM me. We can exchange discords if you'd like.
You don't really ever use $_GET with laravel, you'd use the Request
object. So as you are very new I recommend you checkout the free courses over at laracasts first to get a bit more of a grasp on how things work, I suggest starting with something like: Laravel 8 from scratch.
First thing is choosing a stack. If you are just starting as webdev go for AMP (apache mysql php).
You can find tons of tutorials about the basics, but once you are ready for something production-ready take a look at Laravel (https://laracasts.com/)
Webdev doesnt mean you need to handle every aspect of the site. There are many webdevs that handle frontend or backend only (though there are also lots that do both).
In addition to the official documentation, PHP The Right Way is highly recommended.
For a video crash course on PHP fundamentals, check out Laracasts. If the API is built on Symfony you might also find SymfonyCasts useful. Laracasts focuses on Laravel specifically alongside general PHP and software development topics.
First of all I recommend checking out Laracasts.
They've got a great series for Laravel beginners called Laravel From Scratch. The latest version of the series was made for Laravel 5.7 but that doesn't matter as there isn't anything in the series that doesn't work with 5.8.
A basic example of retrieving API data and dumping it to a database table in Eloquent looks like this:
public function getGuzzleRequest() { $client = new \GuzzleHttp\Client(); $request = $client->get('http://api.example.com/v1/model'); $items = $request->getBody();
$stored = Model::createMany($items);
dd($stored); }
create()
).To be fair, if that is your first week, I'd suggest you visit laracasts.com and finish some of their courses there :) They will explain everything and give you examples :)
​
As for now... Well, since it's database related - entries in the database has to be related via a foreign key. This way, you'll have access to the application if it's mapped correctly
https://codecourse.com/watch/laravel-acceptance-testing
https://laracasts.com/series/lets-build-a-forum-with-laravel
https://laravelupandrunning.com (each chapter has a section about writing tests for the chapter material)
This example you've given isn't too bad as far as efficiency goes, but the strategies you're using are likely to result in the "n+1" problem.
If you have an laracasts account (which I hope you do if you're trying to become a better Laravel developer), you should watch this lesson:
Continue learning PHP and learn Laravel from http://laracasts.com.
Start by going through all/some the courses at: https://laracasts.com/skills/php
If you go through all of that, you will have quite a bit of modern PHP and back-end knowledge.
A really solid look at it in some detail is the Laracasts Webpack for Everyone series. This is 13 videos that go into how to set it up practically to do basic things, like sass compiling, minification, bundling, etc.
Have you considered Elasticsearch? I currently use a combo of Elasticsearch and Vuejs for search-as-you-type functionality. With Elasticsearch's javascript client I am getting a response time of 8ms on my local machine running homestead.
Regardless of what you use, add a click event listener the the drop down list you are rendering with Vue. Bind the data to your input so when the user clicks the list, the input is updated to reflect what the user clicked.
<input v-model="searchquery" @keyup=startSearch name="query" > <div v-for="result in results"> <button class="autofillbtn" v-html="result.category_name" v-on:click.prevent="selectAndClear(result.category_name)" ></button> </div>
and the Vue instance
new Vue( { el: '#app', data: { searchquery: '', results: [] }, methods: { startSearch: function() { // search logic for elasticsearch, algolia, etc. here
}, selectAndClear: function(category_name) {
// set the category to the searchquery input this.searchquery = category_name;
// clear the result list this.results = [];
} } });
Laracasts has a decent video on how to get started: https://laracasts.com/series/search-as-a-service Code Blade Nepal also has some pretty good videos on Elasticsearch (https://www.youtube.com/watch?v=ZO7SBXcdBKw&list=PLl0rlrKS77MpXdRfD77mj6qAHOzu7Zqc2)
Regardless of what you choose there is a bit of a learning curve
Use passport.
I know its the typical answer and you already addressed it, but Passport is Laravel's official solution to exactly what you are trying to create.
Watch this video thats created by Taylor himself as a quick guide to setting up and configuring Passport https://laracasts.com/series/whats-new-in-laravel-5-3/episodes/13
I believe Jeffrey Way over at https://laracasts.com/ has a series on this using laravel/php and sql.
Even his slogan is "It's Kinda Like Netflix for Your Career!".
I highly recommend. There are some free clips that you can watch to determine if it is something for you.
yeah, it's how we all start out. Yes, use a framework and learn about MVC Yes, learn object-oriented code, it makes your code a lot cleaner and easier to manage, keeps everything DRY. Check out the samples of PHP/Object oriented code on Laracasts.com
Another skill you need to learn as a student is how to get help from other developers. Developers (including your co-workers) can't help you until they understand the problem. When the problem is "how to write code" you need to share code or provide a demo that is not working. You could use something like https://gist.github.com/ to show us the template / controller / javascript and then pose a question. If you cannot get a basic template / controller / model working I'd highly advise you go through this free video course https://laracasts.com/series/laravel-5-from-scratch
I assume you are using Laravel since you're in the Laravel subreddit.
I would estimate Vue as Laravel enthusiastically supports using it with their PHP framework for client side stuff. They made a whole video series about it.
If you are willing to pay for this, then you might as well use Forge : https://forge.laravel.com/
This service (created by the creator of Laravel) allows you to manage a server and install a Laravel app very easily via a web interface.
There's even a video series (free) on Laracasts explaining how Forge works: https://laracasts.com/series/server-management-with-forge/episodes/1
I started with Codeigniter (don't) and fumbled my way through Laravel for awhile before "getting it."
Do laracasts, watch the Laravel 5 Fundamentals series, and read the docs.
Then, learn by failing. Make sites, figure out why they're not great, make more sites (only better).
> "I have read the usual recommended books, and now I want a dictionary to quickly look up a summary of a buzzword to refesh my understanding".
The thing is, you haven't. You said "I am now trying to modernize my knowledge as quickly as possible". You won't get there with a TLDR dictionary. But with your experience, you'll still get there fast. Here's my quicklist:
There are a few posts kicking about that cover this: http://stackoverflow.com/questions/17739931/when-to-use-eloquent-orm-over-fluent-query-builder https://laracasts.com/discuss/channels/general-discussion/eloquent-is-so-slow
Generally, eloquent is fine for most things. I've benchmarked in my own (simple) application and saw basically no difference. There are no particularly large or complex queries in it though.
If you need to work with a model / collection, then eloquent is generally the way to go. It also offers you loads of additional features like custom methods, mutators, attribute casting and so on...They just make life easy
Fluent on the other hand will return an array or StdClass of just StdClass depending on the call.
From reading about though, apparently eloquent can slow down for very large data sets due to it making models within collections for each model returned. I've not experienced this myself, as I've not got any data sets that large, so I can't comment on the validity of it. Maybe others can offer an insight?
I've seen projects use both, so I don't think there is a hard rule about which one to use. Like everything in Laravel, use what feels 'right' for the situation. I use eloquent for everything, but I'm not dealing with anything complex.
You can use the debug bar to find out query times easy: https://github.com/barryvdh/laravel-debugbar
If you have a Laracasts subscription, I highly recommend this episode: https://laracasts.com/series/incremental-api-development/episodes/6
Basically you "abstract" the response messages into their own methods.
I implemented this system at work. We created an ApiController
which hold various methods like setStatusCode()
, respondWithError()
, 'respondWithValidationError()and
respond(). The actual Controller extends the
ApiController`.
Then you can do stuff like this:
$this->setStatusCode(422)->respondWithError('Validation failed!');
The Stripe API has methods for tracking customers, specifically, you'll want to record your customer ID and log it in your database along with their email, name, etc. That ID will allow you to look up info on them later.
https://stripe.com/docs/api#retrieve_customer
You may also find these videos helpful from Laracasts. https://laracasts.com/lessons/painless-subscriptions-with-laravel-and-stripe
I would use laravel version 5, and go through that tutorial.
Then have a look at https://laracasts.com/series/whats-new-in-laravel-5-1 and learn the differences.
The basics of the laravel framework (and laravel mindframe) have not changed a lot between 5 and 5.1
What differences are you struggling with?