midwestdev

midwestdev

Member Since 5 Years Ago

Experience Points
15,110
Total
Experience

4,890 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
140
Lessons
Completed
Best Reply Awards
2
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 4
15,110 XP
Oct
17
1 month ago
Activity icon

Replied to Trying To Parse A Date From An Api, Getting Weird Results From Carbon.

You're brilliant, thank you. That was driving me wacky.

Activity icon

Replied to Trying To Parse A Date From An Api, Getting Weird Results From Carbon.

I tried that and got the same result

this is what I suppose to be getting

May 31, 2019 - 8:21 AM

Activity icon

Started a new Conversation Trying To Parse A Date From An Api, Getting Weird Results From Carbon.

This is what the api returns for the datetime (which I assume is microtime) 1559308911000 and when I use

{{ \Carbon\Carbon::createFromTimestamp($item['createdDateTime']) }}

it returns this as the result

51382-07-13 20:10:00

Any idea what is going on. I should be getting day month year

Sep
30
1 month ago
Activity icon

Replied to Laravel Ignition (upgraded From 5.8)

Thank you, you are a gentleman and a scholar.

Activity icon

Started a new Conversation Laravel Ignition (upgraded From 5.8)

Still using old Symfony component. How do I turn on ignition.

Sep
27
1 month ago
Activity icon

Started a new Conversation Tutorial For 6.0 That Doesn't Require Laravel/ui For Creating Auth

I don't much care for using VUEJS. Just personal preference, since Laravel as removed make:auth I was wondering if anyone knows of a tutorial that allows to build the auth and registration system without using laravel/ui

Jun
27
4 months ago
Activity icon

Replied to Laravel In Ubuntu

Google

Jun
26
4 months ago
Activity icon

Replied to Laravel In Ubuntu

The A in LAMPP is Apache

Fresh server

sudo apt update && sudo apt upgrade

sudo apt install php7.2-common php7.2-cli php7.2-gd php7.2-mysql php7.2-curl php7.2-intl php7.2-mbstring php7.2-bcmath php7.2-imap php7.2-xml php7.2-zip

curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer

composer create-project --prefer-dist laravel/laravel my_app

@php artisan key:generate --ansi

cd ~/my_app php artisan serve

May
28
5 months ago
Activity icon

Replied to Merge Two Arrays Based On Partial String In Key Value

Thank you, with a small modification I was able to get it output exactly how I wanted

public function handle($data1, $data2) {
    

    $grp1 = $data1->groupBy(function ($i) {
        $matches = [];
        preg_match('/\d{6}/', $i['CIRCUIT'], $matches);
        return $matches[0];
    });

    $grp2 = $data2->groupBy(function ($i) {
        $matches = [];
        preg_match('/\d{6}/', $i['CAT_DESCRIPTION'], $matches);
    
        return $matches[0];
    });

    $grp = $grp1->map(function ($i, $k) use ($grp2) {
        $cd = data_get($grp2, $k . '.0.CAT_DESCRIPTION');
        if (!!$cd) $i = array_merge($i->first(), ['CAT_DESCRIPTION' => $cd], ['IN_BOTH'=>'TRUE']);
        
        if (!$cd) $i = array_merge($i->first(), ['CAT_DESCRIPTION' => ''],['IN_BOTH' => 'FALSE']);
        return $i;
    });

    return $grp;
}
May
23
5 months ago
Activity icon

Replied to Merge Two Arrays Based On Partial String In Key Value

This is what I came up with, and it's somewhat close

    $data = $queryClass->builder($query);
    
    $array = json_decode(json_encode($data), true);

    $data2 =  $queryClass->builder($query2);
    
    $array2 = json_decode(json_encode($data2), true);

    $pattern = '/(?:\d{4,7})/';

    $result = Array();
    foreach ($array as $key_1 => &$value_1) {
        // if($value['name'])
        foreach ($array2 as $key_1 => $value_2) {
            if((preg_match($pattern, $value_1['CIRCUIT'])) ==  preg_match($pattern, $value_2['CAT_DESCRIPTION'])) {
                $result[] = array_merge($value_1,$value_2);
            }
        }

    }

    dd($result);

but it's taking every array2 and appending it to every single array1 and created an array of 65000 in length

Activity icon

Started a new Conversation Merge Two Arrays Based On Partial String In Key Value

I have got two arrays that I need to merge, the only way to merge the data is by one tiny partial piece of information in CAT_DESCRIPTION and CIRCUIT a 6 digit number. I can use a regular expression to /[0-9]{6}/ but I am not quite sure how to map the data.

$data1 returns an array like this

object(stdClass)#683 (3) {
    ["CIRCUIT"]=>  string(19) ".LXFP.144374..LB"
    ["DESCRIPTION"]=>   string(15) "This is the description"
    ["INSTALL_DATE"]=> string(10) "2015-09-25"
  }

$data2 returns an array like this

  object(stdClass)#687 (1) {
       ["CAT_DESCRIPTION"]=> string(37) "LXFP/144374//LB Slightly different description"
  }