DavidWeller01

DavidWeller01

Member Since 1 Year Ago

Experience Points 3,820
Experience
Level
Lessons Completed 37
Lessons
Completed
Best Reply Awards 0
Best Answer
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

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

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

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

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

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

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

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

02 Mar
10 months ago

DavidWeller01 started a new conversation Namespace/Controller Problem

In an older version of laravel i could use the below. I have been putting my controllers in their own folders to keep things tidy.

I keep getting the error Class App\Http\Controllers\Admin\Products\ProductsController does not exist

Route::group(['namespace' => 'Admin', 'middleware' => 'auth'], function() { // Controllers within the App\Http\Controllers\Admin Namespace // Dashboard home page Route::get('admin/index', '[email protected]');

    Route::group(['namespace' => 'Products'], function() {

        // Controllers within the App\Http\Controllers\Admin\Products Namespace
        Route::get('admin/products/index', '[email protected]');
    });

});

Can anyone tell me why this no longer works in Laravel 5.5.* anymore

08 Jan
1 year ago

DavidWeller01 left a reply on Accessing Mailgun Webhook Post Array

{ "tags": [], "delivery-status": { "mx-host": "hotmail-com.olc.protection.outlook.com", "attempt-no": 1, "description": "", "session-seconds": 3.1470839977264404, "code": 250, "message": "OK" }, "storage": { "url": "https://se.api.mailgun.net/v3/domains/mg..co.uk/messages/eyJwIjpmYWxzZSwiayI6ImRmNDVhYTE4LTg2MTctNGE0NC1iMzE0LTY5MTEwY2RmNjUzYiIsInMiOiJhN2VjOGRjYjVhIiwiYyI6InRhbmtiIn0=", "key": "eyJwIjpmYWxzZSwiayI6ImRmNDVhYTE4LTg2MTctNGE0NC1iMzE0LTY5MTEwY2RmNjUzYiIsInMiOiJhN2VjOGRjYjVhIiwiYyI6InRhbmtiIn0=" }, "log-level": "info", "id": "Uwgwsef5SnG1JtgC9fH3kg", "campaigns": [], "user-variables": {}, "flags": { "is-routed": false, "is-authenticated": true, "is-system-test": false, "is-test-mode": false }, "recipient-domain": "hotmail.com", "timestamp": 1515418975.594767, "envelope": { "transport": "smtp", "sender": "[email protected]", "sending-ip": "184.173.153.194", "targets": "[email protected]" }, "message": { "headers": { "to": "Mrs Katie Barnes [email protected]", "message-id": "5c5e0ed1e84fc6e02d31c49b0ace8397@www.hetasfitter.co.uk", "from": "[email protected]", "subject": "Ramsbottom Stoves Have Published Your Quotation, ref:1082" }, "attachments": [], "size": 5341 }, "recipient": "[email protected]", "event": "delivered" }

Above is the full posted array that is sent to me from the MailGun email service

I have done, json_decode($request->get('message-headers')); and looped through it with foreach() but it still returns the same as above.

I do an if statement to try and find the subject field in the loop but i cannot get this item and it's value. I want to use the subject field to find the same item in the database so i can update it's delivery status.

If you have an example of how you might go about looping through a nested array like the one above i can give it a try. I've looked all over the internet but not found anything that works.

Hope you can help me out here...not much hair left now :(

DavidWeller01 left a reply on Accessing Mailgun Webhook Post Array

Ah right OK.

This is posted back from the mailgun services to a page of my choosing through a webhook service.

So what i am trying to work out is how do i filter through the JSON data so i can access each item such as message-id and subject.

In laravel i am doing it like this

public function delivered(Request $request) { // Dump to test //echo $request->get('recipient'); //echo $request->get('subject'); $headers = $request->get('message-headers');

    foreach ($headers as $header => $value){

    echo '<pre>';

        if ($header == 'subject'){
            echo 'subject: '.$value;
        }


    echo '</pre>';
    }
}

Any ideas Bobby?

Cheers, Dave

07 Jan
1 year ago

DavidWeller01 started a new conversation Accessing Mailgun Webhook Post Array

What is the best way to filter through this data below. I am trying to access the subject in the header array but with no luck at all. I need to access the headers to cross ref in the database and update it's status. By the way this is only part of the post from Mailgun, i can access everything else except the message-headers

"message": { "headers": { "to": "Mr David Weller [email protected]", "message-id": "8326ffca98d45f37c85fe17c096f3359@www.hetasfitter.co.uk", "from": "Ramsbottom Stoves [email protected]", "subject": "Ramsbottom Stoves Survey Confirmation" }, "attachments": [], "size": 2510 },

Any help would be most welcome from a newbie...cheers!