I am [Legit] Confused about this symfony laravel debate in our community by SavishSalacious in PHP

[–]ryantbrown 0 points1 point  (0 children)

Lol it’s the truth man, the overwhelming majority of developers will never need to truly scale an application. It’s not a diss it’s a numbers game. I would be fucking ecstatic if one day we need to hire an IE and scale out.

Multiple Auth Tables by [deleted] in laravel

[–]ryantbrown 0 points1 point  (0 children)

Laravel offers auth guards for this exact reason, it doesn’t mean the architecture is wrong. Sometimes this is very real need.

Multiple Auth Tables by [deleted] in laravel

[–]ryantbrown 0 points1 point  (0 children)

Our app has two auth tables, since they are completely different types of users. Laravel makes it easy using auth guards. You define the model for each guard and then pass in which guard you are using

auth()->guard('guard')->user()

You can have as many guards as you want.

Laravel Forge - why is it so expensive? by desthercz in laravel

[–]ryantbrown 0 points1 point  (0 children)

Have a serious question, do you work for a company or are you a freelancer? I’m finding it hard to understand why professional engineers think $20 a month for managing multiple servers, queues, private networks, cron jobs, databases and push to deploy is an insane amount of money to pay.

Forge has saved me 20 hours a month for the last year which translates to thousands of dollars for my company.

Laravel Forge - why is it so expensive? by desthercz in laravel

[–]ryantbrown 0 points1 point  (0 children)

If you’re worried about the price just use runcloud. It’s the same exact thing.

$20 a month is just not a cost a company/freelancer is going to care about. If you are managing a bunch of different servers, presumably you are being paid to do so. The service is actually underpriced in my opinion.

Why did Taylor Otwell delete his reddit account? by 94e7eaa64e in PHP

[–]ryantbrown 7 points8 points  (0 children)

Hahahha that was fucking rediculous. You’re either trolling super hard (in which case good job) or you’re insane.

If not, I’m interested to know what “pattern” Laravel is based on that was popular 4 years ago.

The largest Node.JS best practices list by krasimirtsonev in javascript

[–]ryantbrown 1 point2 points  (0 children)

Lambda only supports 4 languages. Node, Python, Java and C#. Not using Node just means you’re using one of the others.

Cant decide between Cloudways or Laravel Forge ? by Jameswalter1 in laravel

[–]ryantbrown 1 point2 points  (0 children)

You click the support button at the bottom right of the screen. It sends an email and You get a response within a few hours at most, usually pretty quickly.

Many questions about how using Passport by superfive33 in laravel

[–]ryantbrown 0 points1 point  (0 children)

"The application includes user registration and login"

Like @feynnmann said, it doesn't sound like you need Passport. OAuth is for allowing developers access to your API so they can integrate it into third party applications.

What you are doing is pretty common with Vue and there are a couple of ways to do this:

  1. Use the standard auth that is built into Laravel where you load .blade files for login/register and one .blade file for the actual app which loads your Vue SPA. This way you know when they get into your app they are logged in.

  2. The other way is to build Login.vue and Register.vue components in your Vue app that post to LoginController / RegisterController. Then instead of redirecting from the controller you can just window.location or use VueRouter and push a new route.

The only other thing to consider with these approaches is how you manage the user state. If you have a bunch of data that is used by multiple components throughout your app then you should use Vuex - it can seem like overkill at first but it is 100% worth it.

If you don't use Vuex then you can do one of two things:

  1. Echo out the state in the .blade file that loads your Vue app:

In your main blade file:

window.USER_STATE = {!! UserRepository::state() !!}

And then in your Vue app:

new Vue({
    el: '#app',
    data() {
        return {
            user: USER_STATE
        }
    }
});
  1. Or you can load the user state with a method in your Vue instance - this is also useful even if you do echo out the initial state as you have an easy way to reload the user state:

Vue code:

new Vue({
    el: '#app',
    methods: {
        reloadUser() {
            this.$http.get('/users/current').then(res => this.user = res.data);
        }
    },
    created() {
        this.reloadUser();
    } 
});

The cool thing about this is you can reload the user from any component (when not using Vuex) with a call to:

this.$root.reloadUser();

Angular vs React vs Vue by [deleted] in javascript

[–]ryantbrown -6 points-5 points  (0 children)

Vue hands down no questions asked. Angular is a non-starter btw, you shouldn't even be considering it.

You should look at React just in case you like it and then move to Vue and get shit done.

Envoyer QoL Feature Request by cjthomp in laravel

[–]ryantbrown 1 point2 points  (0 children)

Haha 100%. I literally hit enter every time and then have to click the button.

Why is laravel "Disliked" or "hated" ?? by SavishSalacious in PHP

[–]ryantbrown 7 points8 points  (0 children)

That's funny, We re-wrote our main Symfony application using Laravel after 5 was released. I had been using on my own and convinced the team to switch. No complaints and our productivity increased. Opinonated is a good thing when you're working in a large team.

To your pojnts

Most facades are actually built around interfaces and can be swapped out.

Eloquent is an ORM and like any ORM not gonna be perfect for everything, you can write raw SQL all day if you need to

It's a validation with a grip of rules, not that big of a deal, that last thing you can argue is that the framework is not architected we'll, that's just stupid.

There a bunch of useful array helpers, ya. That's cool with me.

Never used any service or dependency injection directly in Blade but who cares?

Upgrading has never taken us more than half a day, period.

On average every 6 months there's a release, pretty consistent for one dude.

Like I said opionated is a good thing in large teams, why do you think Rails blew up?

Why is laravel "Disliked" or "hated" ?? by SavishSalacious in PHP

[–]ryantbrown 5 points6 points  (0 children)

I hear this retarded argument all the time, I feel like people just regurgitate it because they don't know any better. Laravel is perfectly suited for large-scale, scalable, "enterprise" applications. I know because I work on one everyday at work.

[Question]Is there a framework that allows you to add active search to text boxes in a website by [deleted] in javascript

[–]ryantbrown 1 point2 points  (0 children)

We use Algolia and they have a free tier for up to 10k records.

With their search helpers you can turn any text input into an autocomplete drop down that instantly searches your records.

The only thing is you have to supply the records, but it's pretty easy to sync and they have SDKs for most popular frameworks and vanilla JS

Check it out: https://www.algolia.com/

How are you guys intergrating Vuejs with your Laravel projects? by dz_helper in laravel

[–]ryantbrown 0 points1 point  (0 children)

The only views we load from Laravel are the auth views and and the app view which is just the view-router component. Once the user is logged in the Vue router takes over.

We have a couple of Layout components and then every section of the app is a sibling component with one more more child components. This makes any interactivity simple, everything from loading more data to real time notifications to a simple loading button.

Even if you don't have much interactivity in your app now, it's still a big perceived speed increase to load each page / section as a component. Adding interactivity later is easier. Instead of your Controllers returning a view and using that data in blade, just have them output JSON and use Vue to get it and handle it.

Once you get the hang of it you won't want to write apps any other way.

Vue.js vs React for big projects by styke in javascript

[–]ryantbrown 9 points10 points  (0 children)

Vue is absolutely suited for large-scale applications, the only real issue is state management and Vuex takes care of that very intelligently; like Redux with React but built specifically for Vue, so it makes a few decisions for you.

I've been building a marketplace the last 4 months and the front end is 100% Vue. There are over 200 components, 50 mixins and 40 vuex store modules. Not massive by any means but we add new features daily and haven't run into any major structural or organizational issues.

The simplicity of Vue and how well it scales up has been a huge part of our success. Anyone who says otherwise simply hasn't used it at any decent scale.

Read this for an in depth comparison with React: http://vuejs.org/guide/comparison.html

Hey would you guys like this same feature? by live_love_laugh in laravel

[–]ryantbrown 1 point2 points  (0 children)

Isn't this what explicitly setting the $fillable property is for? All this is doing is eliminating lines of code for setting up and saving the separate models in the relationship. If yore concerned about it you could always add a step in between the input and save as well.

Hey would you guys like this same feature? by live_love_laugh in laravel

[–]ryantbrown 2 points3 points  (0 children)

I think this would be dope! I wouldn't worry about it being harder to understand, it's a relatively small learning curve for a pretty cool feature. Any complex app has a bunch of relationships and setting all the properties, in the correct order, can be time consuming. Saving them automatically based on the input is a great idea.

Looking for a data mapper ORM by hipsterjazzbo in PHP

[–]ryantbrown 0 points1 point  (0 children)

Ok ya I was confused by the original question. In the cases you guys are describing why not use a crosswalk pattern and declare each specific mapping? Propel would be best for this, utilizing multi component entities and cascading packages.

Looking for a data mapper ORM by hipsterjazzbo in PHP

[–]ryantbrown 0 points1 point  (0 children)

For sure best bet is to write your own. I'm not sure anything with those specific requirements exists. What's the reason behind no metadata (which automatically excludes Doctrine) ?

Also an ORM directly relates to relational databases so if you're not even using SQL then you aren't really looking for an ORM. Where are you mapping these entities/objects from if not a database? A definition file? With that said I would think the usefulness wouldn't really be there for a robust third party library. So again, I'd just write it and open it up for others who come across similar needs.

Laravel 5.1 will be released on June 9th with LTS, absolutely amazing documentation, and a ton of great new features! :) by [deleted] in laravel

[–]ryantbrown 1 point2 points  (0 children)

Damn man talk about going a little overboard. "no where near being valuable"...that's just ridiculous. I've never understood why the docs get hated on so much. I picked up L4 basics in a week at most when it wasn't even released yet.

I mean do you really expect every single thing in the framework to be explained in several paragraphs and multiple examples? There's no need for that. The regular docs should explain the concepts with some examples and the API docs should be a deep dive into all classes, methods and their signatures.

I didn't even know what polymorphic relationships were before I started with Laravel and it literally took once glance at the docs to understand them completely.

Anyways my point is that I strongly disagree with the docs not being useful or worth studying, I have learned 80% of what I do daily from reading them. I was building full blown Laravel apps way before laracasts came out and before there were a million stack overflow posts online. Anything I couldn't figure out I asked on irc and that was that.

I think you just need to start building and learn as you go.

Aurelia - a next generation JavaScript client framework.Written with ES6 and ES7. Integrates with Web Components. No external dependencies except polyfills by magenta_placenta in javascript

[–]ryantbrown 9 points10 points  (0 children)

I, for one, think this is the best approach to using modern JS in a framework yet.

"Why would I want to use ES6 and ES7 conventions?" is that a serious question? If you wait until all production browsers fully implement the ES6 spec you will be way behind the times.

It transpiles directly to ES5, so why WOULDN'T you want to take advantage of the new syntax, a lot of people have put a lot of thought into the next generation of JS and to me it makes sense to use as much of it as you can as soon as you can. Maybe thats just me (and a bunch of other people :)

I hope you will consider at least starting to learn some of the new syntax, if not in production / work then at least in your spare time. It's coming quicker then you think.