grenadecx

Webdeveloper at Rocketlabs AB

Member Since 2 Years Ago

Experience Points
30,630
Total
Experience

4,370 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
3
Lessons
Completed
Best Reply Awards
48
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

  • Community Pillar

    Earned once your experience points ranks in the top 10 of all Laracasts users.

Level 7
30,630 XP
May
06
1 week ago
Activity icon

Replied to Does Not Comply With Psr-4 Autoloading Standard. Skipping.

You're right, thanks. I thought I tried changing that, but maybe composer didn't care until I redownloaded the package from the vcs again.

I ended up with adding an additional

"Rocketlabs\Helpers\App\": "src/app/",

Thanks guys for explaining.

May
04
1 week ago
Activity icon

Replied to Does Not Comply With Psr-4 Autoloading Standard. Skipping.

Alright, that still confuses me however.

The reason for me adding the extra app inside the namespace is because the file is inside app/Models folder. Isn't that how it should be?

If I have a file structure like this:

composer.json
src/Test1.php
src/app/Models/Test2.php
src/app/Events/Test3.php

If I kept

{
    "psr-4": {
        "Rocketlabs\\Helpers\\": "src/"
    }
}

What namespaces would be correct for the files above then?

I appreciate taking the time to walk me through this.

Activity icon

Replied to Does Not Comply With Psr-4 Autoloading Standard. Skipping.

It's hosted on a private git. But since the package is pretty stripped, I've imported it into a github repo:

https://github.com/grenadecx/helpers/tree/v2

I've read the upgrade guides but that doesn't really help with upgrading the package or about the psr-4 error/wrningI get. I would assume it only have with the composer.json, the filestructure and the namespace in the file, but what isn't adding up?

Activity icon

Replied to Does Not Comply With Psr-4 Autoloading Standard. Skipping.

Thanks. This is my own package. I run latest composer as of today, 2.0.13 with php 8.0.5.

But as I get that warning, I would assume either my structure or namespace is wrong, but I can't figure out what I need to change to get it psr-4 compliant because it looks fine to me.

Activity icon

Started a new Conversation Does Not Comply With Psr-4 Autoloading Standard. Skipping.

I'm currently updating an old Laravel app with some packages from 5.7 to 8. But I've run into warnings or errors such as:

Class Rocketlabs\Helpers\App\Models\Emailvalidator located in ./vendor/rocketlabs/helpers/src/app/Models/Emailvalidator.php does not comply with psr-4 autoloading standard. Skipping.

And I'm not sure what I'm doing wrong. I have a package at gitlab called rocketlabs/helpers.

Simpliefied file structure

composer.json
src
src/app/Models/Emailvalidator.php

And inside that file src/app/Models/Emailvalidator.php, I have the following namespace:

namespace Rocketlabs\Helpers\App\Models

My composer.json have the following:

{
    "name": "rocketlabs/helpers",
    "description": "Helper package",
    "authors": [
        {
            "name": "",
            "email": ""
        }
    ],
	"autoload": {
		"psr-4": {
			"Rocketlabs\\Helpers\\": "src"
		},
	},
    "minimum-stability": "dev",
	"extra": {
		"laravel": {
			"providers": [
				"Rocketlabs\\Helpers\\HelpersServiceProvider"
			]
		}
	}
}

If a kind soul could point me in the right direction I would really appreciate it. What am I missing?

Feb
09
3 months ago
Activity icon

Replied to What's Optimal - Laravel Websockets

Alright, then I know what to expect and what I need to do. Thanks a lot for the feedback, I really appreciate it guys!

Activity icon

Replied to What's Optimal - Laravel Websockets

Thanks guys. You've given me a lot to think about, I really appreciate it.

@martinbean A polling solution might be more effecient right now to accomplish this then, but since I really want it to be more realtime later on, what @tippin suggest might be a solution towards that.

Would that mean if I have for example 101 users listening to stock price, would that require me to send 2 events with a batch of 100 channels in the first and 1 in the second? Just making sure I understand the solution fully.

This would work great for the moment, since the ciritcal parts for the stock price updates are what I have on a "watchlist" and my current "holdings", the rest of the stocks aren't as that important to get realtime info from the client.

With that said, if I want realtime data from stocks that aren't in my holdings/watchlist, would it make sense to have maybe something like a presence channel, to subscribe/unsubscribe to the stocks I'm currently viewing from the client? I mean I would need to have a way to subscribe to the stocks I'm viewing somehow. And I would assume that handling that with an extra table to keep user id and stock id, or keeping user id and a json field with all the stock_ids might be more efficient if I'm going to update that table frequently.

What do you guys think?

Activity icon

Replied to What's Optimal - Laravel Websockets

Thanks for the reply guys.

The limit haven't been determined yet, but it's not farfetched that it could be at least up to around 25 stocks. Whatever the number ends up as, I would like to find an optimal solution.

@martinbean Your solution sounds sound, but wouldn't that also result in sending that client a lot of unnecessary data? For example if I have like 10k stocks in the system, and all those prices are updated every 15min, wouldn't that mean the clients receives all those changes, even if the client is only viewing like 25 of them?

I guess I'm just trying to look for a way to only receive the data the client needs. I agree that opening up like to 25 channels is horrible, but that way I would only get the data I needed. Could this be done in some other way?

Feb
08
3 months ago
Activity icon

Started a new Conversation What's Optimal - Laravel Websockets

Hi there!

I'm in the making of a stock/trading application. This application gets frequent updates on current stock market prices every 15 minutes. And I need to push these out to the clients as they get updated.

Laravel Websockets with echo seems like a great solution for this and everytime a stock gets updated, I send an event with the current price on that stock. As for the clients, they need to listen and get updates on the stocks they are currently having in their list.

One way would be to have a public channel for this, and send all stock data to the clients and have the clients loop that data to update the correct stock. Another one would be to have the clients listen to the stocks they are viewing on different websocket channels, so they only get feeded the data they need.

But the dilema here is, if a client is viewing a table with like 25-50 stocks, I would either need to listen to 25-50 channels, or listen to one channel that gets all stocks data even those that aren't interesting for the client.

How would you go about it? What makes most sense really? Especially when many clients starts connecting.