aGandrass

aGandrass

Member Since 3 Years Ago

Spain, Mallorca

Experience Points
8,800
Total
Experience

1,200 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
79
Lessons
Completed
Best Reply Awards
0
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.

Level 2
8,800 XP
Jul
20
2 months ago
Activity icon

Replied to Laravel Auth - 500 Server Error

Thanks tykus. Unfortunately, I have no typo in the code. Only here in the description. If I look into my forge Laravel log I get to see this: ls: cannot access '/home/forge/XXX.XXX.com/storage/logs/*.log': No such file or directory

I have further notices that it only happens when the controller sends to another view. Otherwise I won't get the error message.

Activity icon

Started a new Conversation Laravel Auth - 500 Server Error

Hello, I have created a new Controller with the public function __contruct which works fine in development environment. But when I upload my app onto my Server and trying to access the new controller I get the error message 500 server error.

Does anybody have an idea? Thank you very much Andre

Jul
19
2 months ago
Activity icon

Replied to Cannot Install Github Repository In Laravel Forge

Yes, I double checked that. I even tried to install another package and got the same error message. So I think it should be that I do not have a Forge SSH Key inserted into Github. But as I try to do that I get the message that the key is already in use.

Jul
18
2 months ago
Activity icon

Started a new Conversation Cannot Install Github Repository In Laravel Forge

Hi, I am trying to install my GitHub repository into Laravel Forge. I get the following error message:

github.com:22 SSH-2.0-babeld-9389d978

github.com:22 SSH-2.0-babeld-9389d978

github.com:22 SSH-2.0-babeld-9389d978

Cloning into 'testhotel.payrelaxx.com'... ERROR: Repository not found. fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

I am using Github for a while now but today it didn't work. So I deleted my SSH Keys on Github to set a new one. But by entering the SSH key taken from Forge into Github I get the info that the SSH Key has already being used. How can I set the SSH Key again?

Thank you Andre

Jun
16
3 months ago
Activity icon

Started a new Conversation Remove Quotation Marks From Eloquent Collection - Chartjs

Hi, I am trying to implement chartjs but I am not able to parse the values to my graph view.

That's my controller: $successfullypaidbyMonth = Newpayment::where('paymentstatus', 'successfully paid') ->select(\DB::raw('SUM(total) as total_amount, MONTH(paymentdate) as month')) ->groupBy(\DB::raw('MONTH(paymentdate) DESC')) ->pluck('total_amount', 'month'); return view('maindashboard', compact('successfullypaidbyMonth');

Here I am trying to get the data: var context = document.getElementById('graph').getContext('2d'); var myChart = new Chart(context, { type: 'bar', data: { labels: {{ $successfullypaidbyMonth->keys() }}, datasets: [{ data: {{ $successfullypaidbyMonth->values() }}, backgroundColor: [ 'rgba(255, 99, 132, 0.2)', 'rgba(54, 162, 235, 0.2)', 'rgba(75, 192, 192, 0.2)' ], }] } })

Unfortunately, I do not get the values. It seems like that it is because the values have quotation marks. ^ Illuminate\Support\Collection {#1229 ▼ #items: array:2 [▼ 6 => "2600.00" 4 => "5300.00" ] }

Does anybody know what to do? Thank you very much Andre

May
27
3 months ago
Activity icon

Replied to How To Send Data To Pusher

Thank you!

Activity icon

Replied to How To Send Data To Pusher

Thank you for your reply. But how do I actually pass the data for example the $sg_payment_id through the dispatch method to my PaymentStatusUpdate Event?

Activity icon

Started a new Conversation How To Send Data To Pusher

Hi, it is my first time working with pusher and I have a little problem. Here is my Webhooks Controller:

    $logbook = Logbook::create([
      'strp_paymentuniqid' => $sg_payment_id,
      'sg_message_id'      => $sg_message_id,
      'sg_event'           => $sg_event,
      'sg_category'        => $sg_category,
      'sg_event_id'        => $sg_event_id,
      'sg_response'        => $sg_response,
      'sg_reason'          => $sg_reason
    ]);
    Newpayment::where('paymentuniqid', $sg_payment_id)
      ->update ([
          'paymentstatus' => $sg_event,
      ]);
    PaymentStatusUpdate::dispatch();
  }

  http_response_code(200);

And that is my PaymentStatusUpdate Event: class PaymentStatusUpdate implements ShouldBroadcast { use Dispatchable, InteractsWithSockets, SerializesModels; public $update = "Test"; /** * Create a new event instance. * * @return void */ public function __construct() { }

/**
 * Get the channels the event should broadcast on.
 *
 * @return \Illuminate\Broadcasting\Channel|array
 */
public function broadcastOn()
{
  return ['paymentstatus'];
    // return new PrivateChannel('channel-name');
}

}

If I check the Pusher Console I do get the message update = Test. Ho do I get the data from my Webhooks Controller passed to Pusher? Thank you all

May
11
4 months ago
Activity icon

Replied to How Secure Is The Env. File?

Thank you RamjithAp

Activity icon

Replied to How Secure Is The Env. File?

Hi Tray2, thank you very much for your quick reply. I am using Laravel Forge to manage my Digital Ocean Server. So I use the local Environment File inside Forge to insert the keys. I have no idea how they set up their document root. Is this enough to be sure that the keys are safe? Thanks again Andre

Activity icon

Started a new Conversation How Secure Is The Env. File?

Hi everybody, I was asking me how secure the env. file really is? Can somebody give me an explication of how actually the env. file works? Can I guaranty a client that their access keys are securely saved in this file?

Thank you very much Andre

Apr
08
5 months ago
Activity icon

Replied to SendGrid Webhooks Setup

Thank you mix5003. It works perfectly!

Activity icon

Replied to SendGrid Webhooks Setup

I have tried a couple of other ways, but can't get it work out. As a response from a Sendgrid Webhooks I get this response:

[{"email":"[email protected]","timestamp":1586372566,"smtp-id":"\u003c14c5d75ce93.dfd.64b469@ismtpd-555\u003e","event":"processed","category":"cat facts","sg_event_id":"4zoQvwDKpfvYRMMUAN_0hQ==","sg_message_id":"14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0"},{"email":"[email protected]","timestamp":1586372566,"smtp-id":"\u003c14c5d75ce93.dfd.64b469@ismtpd-555\u003e","event":"deferred","category":"cat facts","sg_event_id":"ysdEduSgoooB1jNjpNQ0PQ==","sg_message_id":"14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0","response":"400 try again later","attempt":"5"},{"email":"[email protected]","timestamp":1586372566,"smtp-id":"\u003c14c5d75ce93.dfd.64b469@ismtpd-555\u003e","event":"delivered","category":"cat facts","sg_event_id":"7nyjeK_8XRhRDnwdg-oBJw==","sg_message_id":"14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0","response":"250 OK"},{"email":"[email protected]","timestamp":1586372566,"smtp-id":"\u003c14c5d75ce93.dfd.64b469@ismtpd-555\u003e","event":"open","category":"cat facts","sg_event_id":"WoZrxeI1EjT8AjOgCgANAA==","sg_message_id":"14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0","useragent":"Mozilla/4.0 (compatible; MSIE 6.1; Windows XP; .NET CLR 1.1.4322; .NET CLR 2.0.50727)","ip":"255.255.255.255"},{"email":"[email protected]","timestamp":1586372566,"smtp-id":"\u003c14c5d75ce93.dfd.64b469@ismtpd-555\u003e","event":"click","category":"cat facts","sg_event_id":"4gL6XuCeLAbMo7UlX_5OVg==","sg_message_id":"14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0","useragent":"Mozilla/4.0 (compatible; MSIE 6.1; Windows XP; .NET CLR 1.1.4322; .NET CLR 2.0.50727)","ip":"255.255.255.255","url":"http://www.sendgrid.com/"},{"email":"[email protected]","timestamp":1586372566,"smtp-id":"\u003c14c5d75ce93.dfd.64b469@ismtpd-555\u003e","event":"bounce","category":"cat facts","sg_event_id":"2SKTPf2jApRcOYBqg16t-w==","sg_message_id":"14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0","reason":"500 unknown recipient","status":"5.0.0"},{"email":"[email protected]","timestamp":1586372566,"smtp-id":"\u003c14c5d75ce93.dfd.64b469@ismtpd-555\u003e","event":"dropped","category":"cat facts","sg_event_id":"-vSk7y8kMVqE0d1GHFm-RA==","sg_message_id":"14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0","reason":"Bounced Address","status":"5.0.0"},{"email":"[email protected]","timestamp":1586372566,"smtp-id":"\u003c14c5d75ce93.dfd.64b469@ismtpd-555\u003e","event":"spamreport","category":"cat facts","sg_event_id":"_wKrPIj8JBgmcCCvwqW31g==","sg_message_id":"14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0"},{"email":"[email protected]","timestamp":1586372566,"smtp-id":"\u003c14c5d75ce93.dfd.64b469@ismtpd-555\u003e","event":"unsubscribe","category":"cat facts","sg_event_id":"wFjlfA6ZZJf0IsoU7B1Sng==","sg_message_id":"14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0"},{"email":"[email protected]","timestamp":1586372566,"smtp-id":"\u003c14c5d75ce93.dfd.64b469@ismtpd-555\u003e","event":"group_unsubscribe","category":"cat facts","sg_event_id":"ISVTQDh18E4yPkIJE_tkMA==","sg_message_id":"14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0","useragent":"Mozilla/4.0 (compatible; MSIE 6.1; Windows XP; .NET CLR 1.1.4322; .NET CLR 2.0.50727)","ip":"255.255.255.255","url":"http://www.sendgrid.com/","asm_group_id":10},{"email":"[email protected]","timestamp":1586372566,"smtp-id":"\u003c14c5d75ce93.dfd.64b469@ismtpd-555\u003e","event":"group_resubscribe","category":"cat facts","sg_event_id":"CYtS7YoDj4mTju1FzGZJ8Q==","sg_message_id":"14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0","useragent":"Mozilla/4.0 (compatible; MSIE 6.1; Windows XP; .NET CLR 1.1.4322; .NET CLR 2.0.50727)","ip":"255.255.255.255","url":"http://www.sendgrid.com/","asm_group_id":10}]

How can I get all "event" values. Should be 11 event values. Thank to you Have a great evening Andre

Apr
07
5 months ago
Activity icon

Started a new Conversation SendGrid Webhooks Setup

Hi, I am trying to set up my SendGrid Webhooks for receiving all responses. With SendGrid sometimes you get two or more events per Webhook sent:

[ { "email": "[email protected]", "event": "processed", "send_at": 0, "sg_event_id": "cHJvY2Vzc2VkLTU3NzAyODgtNEJqQWpUb2lTc3V0Y21Ta0hsS0pCQS0w", "sg_message_id": "4BjAjToiSsutcmSkHlKJBA.filterdrecv-p3iad2-8ddf98858-sn8p2-20-5E8CE244-F.0", "smtp-id": "[email protected]", "timestamp": 1586291268 }, { "email": "[email protected]", "event": "delivered", "ip": "167.89.100.176", "response": "250 2.0.0 OK 1586291271 o59si2549636eda.39 - gsmtp", "sg_event_id": "ZGVsaXZlcmVkLTAtNTc3MDI4OC00QmpBalRvaVNzdXRjbVNrSGxLSkJBLTA", "sg_message_id": "4BjAjToiSsutcmSkHlKJBA.filterdrecv-p3iad2-8ddf98858-sn8p2-20-5E8CE244-F.0", "smtp-id": "[email protected]", "timestamp": 1586291271, "tls": 1 } ]

I have tried to use the following code, but now it saves 7 times (lines) the first array into my database:

public function handleSendgrid(Request $request) { foreach ($request as $value) { if(isset($request[0]["paymentuniqid"])) { $sg_payment_id = $request[0]["paymentuniqid"]; } else { $sg_payment_id = NULL; } if(isset($request[0]["sg_message_id"])) { $sg_message_id = $request[0]["sg_message_id"]; } else { $sg_message_id = NULL; } if(isset($request[0]["event"])) { $sg_event = $request[0]["event"]; } else { $sg_event = NULL; } if(isset($request[0]["category"])) { $sg_category = $request[0]["category"]; } else { $sg_category = NULL; } if(isset($request[0]["sg_event_id"])) { $sg_event_id = $request[0]["sg_event_id"]; } else { $sg_event_id = NULL; } if(isset($request[0]["response"])) { $sg_response = $request[0]["response"]; } else { $sg_response = NULL; } if(isset($request[0]["reason"])) { $sg_reason = $request[0]["reason"]; } else { $sg_reason = NULL; }

  $logbook = Logbook::create([
    '_paymentuniqid' => $sg_payment_id,
    'sg_event'       => $sg_event,
    'sg_category'    => $sg_category,
    'sg_event_id'    => $sg_event_id,
    'sg_response'    => $sg_response,
    'sg_reason'      => $sg_reason
  ]);
}

  \DB::table('offsessionpayments')
      ->where('paymentuniqid', $sg_payment_id)
      ->update([
        'paymentstatus' => $sg_event,
      ]);

http_response_code(200);

}

Does anybody know how to get every line from each array? Thank you Andre

Apr
05
5 months ago
Activity icon

Replied to SendGrid API - Get X-Message-ID After Sending Mail

Thank you very much Snapey!

Apr
04
5 months ago
Activity icon

Replied to SendGrid API - Get X-Message-ID After Sending Mail

Thank you Snapey, it works! :) Now I get the following response:

array:13 [▼ 0 => "HTTP/1.1 202 Accepted" 1 => "Server: nginx" 2 => "Date: Sat, 04 Apr 2020 17:43:14 GMT" 3 => "Content-Length: 0" 4 => "Connection: keep-alive" 5 => "X-Message-Id: 6T_EJ2NWQ7iEJcMJUrL0Wg" 6 => "Access-Control-Allow-Origin: https://sendgrid.api-docs.io" 7 => "Access-Control-Allow-Methods: POST" 8 => "Access-Control-Allow-Headers: Authorization, Content-Type, On-behalf-of, x-sg-elas-acl" 9 => "Access-Control-Max-Age: 600" 10 => "X-No-CORS-Reason: https://sendgrid.com/docs/Classroom/Basics/API/cors.html" 11 => "" 12 => "" ]

I have tried to access array 5 to get X-Message-ID. But instead of just getting the id itself, I get this: "X-Message-Id: 6T_EJ2NWQ7iEJcMJUrL0Wg". That's the entire value inside the array 5.

Do you know how I can get only the ID itself? Thanks again Andre

Apr
03
5 months ago
Activity icon

Started a new Conversation SendGrid API - Get X-Message-ID After Sending Mail

Hi, I am trying to get the x-message-id out of the Sendgrid api response after successfully sending an email. That's the Sendgrid api code:

  $email ->setFrom("[email protected]");
  $email ->setSubject("Testmail via Sendgrid API");
  $email ->addTo($clientMail);
  $email ->addContent("text/html", "<strong>and easy to do anywhere, even with PHP</strong>");
  $email ->setClickTracking(true, true);
  $email ->setOpenTracking(true, "--sub--");
  $apiKey = config('services.sendgrid.api-key');
  $sg     = new \SendGrid($apiKey);
  try {
    $response = $sg->send($email);
    dd($response);
  } catch (Exception $e) {
  }

With the dd command I get the following response:

^ SendGrid\Response {#295 ▼ #statusCode: 202 #body: "" #headers: array:13 [▼ 0 => "HTTP/1.1 202 Accepted" 1 => "Server: nginx" 2 => "Date: Fri, 03 Apr 2020 20:48:36 GMT" 3 => "Content-Length: 0" 4 => "Connection: keep-alive" 5 => "X-Message-Id: TZISGRBpQemYzLPS7t9IHQ" 6 => "Access-Control-Allow-Origin: https://sendgrid.api-docs.io" 7 => "Access-Control-Allow-Methods: POST" 8 => "Access-Control-Allow-Headers: Authorization, Content-Type, On-behalf-of, x-sg-elas-acl" 9 => "Access-Control-Max-Age: 600" 10 => "X-No-CORS-Reason: https://sendgrid.com/docs/Classroom/Basics/API/cors.html" 11 => "" 12 => "" ] }

I am trying to get the headers[5] x-message-id but without success. I have tried this command: dd($response->headers); But I get the following error: Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR) Cannot access protected property SendGrid\Response::$headers

Anybody an idea? thank you very much Andre