justl00king

justl00king

Member Since 2 Years Ago

Experience Points
990
Total
Experience

4,010 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
0
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start-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-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-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist 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.

Level 1
990 XP
Nov
08
1 week ago
Activity icon

Replied to Where Query Using And Md5 Value - Lavavel 5.3

@jaytee - thanks, I'll read these. When I use this query I'm able to take the hashed unique_id from the email and search for the record in my db table. That's why I'm wondering, do I even need a hashed value in the table?

 User::whereRaw('md5(unique_id) = "' . $mdId . '"')->first();
Activity icon

Replied to Where Query Using And Md5 Value - Lavavel 5.3

@jaytee for a unsubscribe link in my emails. I md5 the unique id in the email so that no one knows what the unique id is in my database. Should I really create a new column with a hash value? What's wrong with the way I'm doing it? It doesn't seem like a good idea to give anyone the unique id, maybe I'm wrong, Also seems silly to create a new column with a hash just for an unsubscribe link. I'm literally just learning how to code so I'm open to suggestions. Thanks for your help.

Activity icon

Replied to Where Query Using And Md5 Value - Lavavel 5.3

@jaytee thanks, but this definitely wouldn't work because $mdid already has md5 applied, this would just be adding md5 to a string with md5 already applied.

Activity icon

Replied to Where Query Using And Md5 Value - Lavavel 5.3

@jlrdw Can you elaborate? I tested it and it's working on my localhost, unless something is different on the live server.

Nov
07
1 week ago
Activity icon

Replied to Where Query Using And Md5 Value - Lavavel 5.3

Thank you. I got this to work:

 User::whereRaw('md5(unique_id) = "' . $mdId . '"')->first();
Activity icon

Started a new Conversation Where Query Using And Md5 Value - Lavavel 5.3

I'm trying to query the database to get the record that matches the unique id for a user.

 User::whereRaw(('md5(unique_id)'), $mdid)->first();

This returns the first id in the database, not the intended user

 User::whereRaw(('md5(unique_id)'), $mdid)->get();

This returns every user in the database

Any suggestions, thank you!

Nov
04
2 weeks ago
Activity icon

Started a new Conversation Help Understanding Laravel - Where To Put Logic

Here is what I have so far. My app has several controllers and inside 2 different controllers, I'm handling forms through several of the methods in these controllers. I need to create a user record in the user table as well as create records in several other related tables for subscriptions, notes, etc and then I also need to send an email to myself and the new user. Also, I'm pushing all the user data to a third party contact management system (CMS).

In order to cut down on writing the logic for creating each of these records in different the controllers, I've prepared all the data and passed it through to my User model into a method called signUp().

Everything is working great, but the signUp() method is really, really big. I was thinking that I should clean it up by breaking out the following parts and put them into their own methods so I can the refactor them to reduce the amount of logic I have and then just call these new methods from inside my signUp() function:

  1. emails that I'm sending to myself and the new user (there are 5 different email versions and depending on which form was filled out, one of them is sent. So, I'm calling a different view file for each version. Also, I'm using the queue when sending them)

  2. sending the data to the third party cms (I'm dispatching a job. Depending on which form was filled out different information is sent to the third party CMS)

My question is this, do I:

  1. Leave them alone (leave them inside the signUp() method)
  2. Move them to their own methods inside the User model and call them from inside the signUp() method
  3. Move them somewhere else

If the answer is 3, where would I move the logic to? For the email logic, should I create a file in \app\Mail folder? And for the logic to send to the third party CMS, where should that go?

Thanks so much for your help!

Oct
31
2 weeks ago
Activity icon

Replied to Logging Emails - Get The Email Subject And Sent To Address On Events

When I do this, I just get a "1" no email address at all, am I missing something? On laravel 5.3

$emails = array_keys($event->message->getTo());

Activity icon

Replied to How To Get The Email Address In The Listener

Thanks, I'm too new to understand how to do this. Not sure if you mean from outside this listener file or inside this listener file.

Activity icon

Started a new Conversation How To Get The Email Address In The Listener

Is it possible to get the user object for both the sender ($user) and recipient ($emailed_user) in my listener? I can't seem to figure it out and am hitting a wall. Here's what I have:

    public function handle(MessageSending $event)
    {

        // get auth or sender object
        $user = !empty(Auth::user()) ? Auth::user() : User::FindByEmail($event->message->getFrom());

    // get recipient user object
        $emailed_user = User::FindByEmail($event->message->getTo());

        $message = [
            'to' => $event->message->getTo(),
            'bcc' => $event->message->getBcc(),
            'from' => $event->message->getFrom(),
            'subject' => $event->message->getSubject(),
            'message' => $event->message->getBody()
        ];
    }
Oct
29
3 weeks ago
Activity icon

Replied to Having Trouble Adding Headers To Specific Path In NGINX

Thanks, @bobbybouwmann, appreciate your help on this. You're right, the try_files in location / & /path passes processing on to the PHP location block, which means no headers are added. What I ended up doing that worked instead of including an external file was added the add_header X-Robots-Tag to the server block with the others and then used a map to control its value based on the $request_uri. Hope that helps someone else that might come across this.

Oct
28
3 weeks ago
Activity icon

Started a new Conversation Having Trouble Adding Headers To Specific Path In NGINX

Trying to add a no index header to a specific path (/path) but it doesn't show up. When I add it in with the other add_header lines, it shows just fine but not when put into location /path {} or even location / {}.

Here's my nginx file:

server {
    listen 443 ssl http2 default_server;
    listen [::]:443 ssl http2 default_server;

server_name mydomain.com;
root /home/forge/mydomain.com/public;

add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
add_header Referrer-Policy "origin";
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains; preload";

index index.html index.htm index.php;

charset utf-8;

location / {
    try_files $uri $uri/ /index.php?$query_string;
}

location /path {
    add_header X-Robots-Tag "noindex" always;
    try_files $uri $uri/ /index.php?$query_string;
}

location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt  { access_log off; log_not_found off; }

error_page 404 /index.php;

location ~ \.php$ {

    try_files $uri /index.php =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
}

location ~ /\.(?!well-known).* {
    deny all;
}
}