WallyJ

WallyJ

Member Since 3 Years Ago

Experience Points
9,770
Total
Experience

230 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
12
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
9,770 XP
Sep
30
1 month ago
Activity icon

Replied to Show Project Code On One Page

Thanks @sinnbeck ! You're always such a great help!!

Activity icon

Replied to Show Project Code On One Page

I might try that, but us Windows guys are lazy, and love to click a few buttons and watch things happen, rather than typing out 20 filenames and misspelling something along the way. :)

Activity icon

Replied to Show Project Code On One Page

I develop in Windows... I know... gag...

:)

Activity icon

Started a new Conversation Show Project Code On One Page

Here's a weird question...

For presentation purposes, I'd like to show a group of people the code it took to create a project in Laravel.

So to keep it somewhat simple, essentially I'd like to put all controllers and views into one file, that I could put up on the screen, and scroll down for people to see.

Is there a quick way to do this, other than to open every controller and view and copy/paste.

I'm thinking there might be a way to combine all files in a folder/subfolders into one file. I could then copy the files I want to include into a folder for this purpose.

Is there some simple utility you've used for this type of thing?

Whatdya think?

Sep
21
2 months ago
Activity icon

Replied to How To Customize Bootstrap CSS In Laravel

I appreciate your response, but I'm looking for more of a direct customization to bootstrap, similar to this video:

https://www.youtube.com/watch?v=aWmiEQYxy1w

I just want to handle it properly within Laravel.

Sep
19
2 months ago
Activity icon

Started a new Conversation How To Customize Bootstrap CSS In Laravel

Currently using CDN for Bootstrap, but thinking I want to customize. Is the best way to download the full bootstrap, then customize using SASS?

Sep
04
2 months ago
Activity icon

Replied to Error On Line That Has Been Edited/fixed

That's a good point @snapey . There is a Cache Manager function in CPanel, and I turned it off, and it has a "Purge" function, which I use to try and help, but it sometimes works and sometimes doesn't. :(

Sep
03
2 months ago
Activity icon

Replied to Error On Line That Has Been Edited/fixed

Unfortunately, for this account I login through CPanel and use the File Manager there. But that does mean that the changes should be immediate.

Activity icon

Started a new Conversation Error On Line That Has Been Edited/fixed

I have a particular project that I work on where I make edits live on the server... I know... let the flaming begin. Without going into particulars, for this project, it has to be this way.

So, sometimes I edit a file, refresh, and it works fine. Other times, like today, I will edit a line, and make a mistake, and as expected, I receive an error on the screen, but when I make the change to fix it, I still get the error, but the line is different, no longer containing the function that could even cause the error.

For instance,

I wrote this line of code as part of a query to restrict records by date:

->whereBetween('renewaldate', [$fromdate, $todate])

It worked just fine. But then I wanted to change the query to actually look for a particular date, instead of a range, so I hastily changed the code to this:

->whereBetween('renewaldate', "2020/08/31")

Which of course produced this error:

Argument 2 passed to Illuminate\Database\Query\Builder::whereBetween() must be of the type array, string given, called in...

Which makes sense because I didn't change the function to "where" rather than "whereBetween", as "whereBetween" requires two dates.

So I made the change to:

->where('renewaldate', "2020/08/31")

Saved the file and refreshed.

Same error. Wait, what? So I clicked on "Application Frames" under the error to see my line of code on the right section of the browser that is causing the problem.

It's the new line. The line highlighted is this:

->where('renewaldate', "2020/08/31")

A "whereBetween" error on a line that no longer says "whereBetween".

The weird part is that if I wait a few minutes and refresh again, the query works fine with no "whereBetween" error.

I thought it was my hosts' caching, and they suggested it had something to do with nginx, but I'm befuddled. This happens regularly. Is this a hosting thing, a Laravel thing?

Any ideas?

Activity icon

Replied to Laravel And APIs

@snapey , @martinbean , what do you guys think about my code mentioned above?

Sep
01
2 months ago
Activity icon

Replied to Laravel And APIs

I have read up on it and have made some progress. I now can get Eventbrite to show a user the OAuth page and after the user confirms permission, it sends the user to the listed URI with a "?code= codegoeshere" which I am supposed to then "post" back to Eventbrite to receive a token, which I can then use for API requests.

The code they say to use is:

curl --request POST \
--url 'https://www.eventbrite.com/oauth/token' \
--header 'content-type: application/x-www-form-urlencoded' \
--data grant_type=authorization_code \
--data 'client_id=API_KEY \
--data client_secret=CLIENT_SECRET \
--data code=ACCESS_CODE \
--data 'redirect_uri=REDIRECT_URI'

which I converted to this:

$ch = curl_init();

        curl_setopt($ch, CURLOPT_URL, 'https://www.eventbrite.com/oauth/token');
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_POSTFIELDS, "grant_type=authorization_code&client_id=APIKEYHERE \n--data client_secret=CLIENTSECRETHERE \n--data code=CUSTOMERCODEHERE \n--data redirect_uri=http://eventappt.test/eventbriteoathrecievetoken'");

        $headers = array();
        $headers[] = 'Content-Type: application/x-www-form-urlencoded';
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

        $result = curl_exec($ch);
        if (curl_errno($ch)) {
            echo 'Error:' . curl_error($ch);
        }
        curl_close($ch);

After changing the key values to the appropriate keys, I go to the URL that calls this controller and the page is white.

If I:

dd($result);

I receive this:

"{"error_description":"client_secret: This field is required.\ncode: This field is required.\nclient_id: Invalid API key- malformed","error":"invalid_request"}"

which implies that I did not submit a client secret, and the API key is "malformed".

This is really my first time trying to convert curl into use in php in Laravel.

Aug
28
3 months ago
Activity icon

Replied to Mailgun - Variable Passing To Email Fail

Certainly do. Thanks again!

Activity icon

Replied to Mailgun - Variable Passing To Email Fail

Interestingly, I didn't even change that line. That's why it didn't work for me. LOL

But, now it works like a champ!

Thanks! I'm going to make your code answer the solution. Can you make the changes to it for future readers?

Thanks again!

Activity icon

Replied to Mailgun - Variable Passing To Email Fail

Now I get the error:

Undefined variable: user

on this line:

$this->user = $user;

And btw, you missed the closing bracket on the markdown line. :)

Activity icon

Replied to Mailgun - Variable Passing To Email Fail

<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;

class ExpirationEmailReminder14Day extends Mailable
{
    use Queueable, SerializesModels;
    public $emailinfo;

    /**
     * Create a new message instance.
     *
     * @return void
     */
    public function __construct($emailinfo)
    {
        $this->emailinfo = $emailinfo;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->subject('Account Has Expired')
        ->markdown('emails.expirationemailreminder14day');
    }
}
Activity icon

Started a new Conversation Mailgun - Variable Passing To Email Fail

This is the code that sends my email:

if (!empty($users)) {
            foreach ($users as $user) {
                if (filter_var($user->email, FILTER_VALIDATE_EMAIL)) {
                    Mail::to($user->email)->queue(new ExpirationEmailReminder14Day($user));
                } else {
                }
            }
        }

Then in the email template, I have this:

Dear {{$user->name}},<br>

which give me the error:

Undefined variable: user

But I thought the entire $user variable was being sent from the Mail::to line.

Activity icon

Replied to Mailgun Improper Email Error

Do I put this just above the "Mail::to" line?

Or put my "Mail::to" line as the execution of the validation?

And on the "else" section, do I just have it do nothing?

Activity icon

Started a new Conversation Mailgun Improper Email Error

When I have Mailgun within my app send emails, everything works fine...

Unless...

Someone edits their email address to something with a typo or improper format, so instead of:

[email protected]

She types her new email address as: [email protected]

Which mailgun rejects mid-process and sends me this error:

"Address in mailbox given [] does not comply with RFC 2822, 3.6.2."

I'm sure I should be catching this somehow on the form so I never have an improperly formatted email address, but is there also a way to have mailgun skip this email and process the rest of the emails.

If my query returns 53 expiring users and sends them an expiration email with a line like this:

Mail::to($user->email)->queue(new ExpirationEmailReminder14Day($user));

It will die with the mailgun error 23 emails in, and then I have to figure out the easiest way to find those 30 people that still need the email and get it sent to them. Also, once I get the bugs out I am going to put this on autopilot through a cron job on the server to run the function via a URL that I route to that controller/function.

Best practices?

Aug
27
3 months ago
Activity icon

Replied to Laravel And APIs

Though... this seems a bit excessive, to get someone's permission to receive a code on their behalf, only to have to send that code back to Eventbrite, to get a token, that can then be used to retrieve information about events on their behalf.

It seems like I have to get permission, to get permission, to get the event info, etc.

Why the code and then the token? Why not just send me a token?

Activity icon

Replied to Laravel And APIs

Ok. I got it to work. I had not set up my settings in the API key with the correct URL's

Now I have. It works now. I think. :)

On to the next step.

Thanks, as always!

Activity icon

Replied to Laravel And APIs

Ok... so I think I had a problem with my key. I changed the key and now my error message says:

The application you're trying to use has made an invalid request to Eventbrite. Please contact the application developer.

Redirect URI hostnames must match

Activity icon

Replied to Laravel And APIs

I'm now realizing that my link has "token" instead of "code" in the URL.

I changed that in my URL but I still get the same error.

Activity icon

Replied to Laravel And APIs

I'm trying the instructions on the server side authorization, which is recommended.

It says to redirect users to the authorization URL, including the API key and URI.

That's what I thought I was doing.

Activity icon

Started a new Conversation Laravel And APIs

I'm a novice at using APIs, and I'm trying a basic connection to an API (Eventbrite).

Via their docs: https://www.eventbrite.com/platform/docs/authentication#authorize-your-users

I am supposed to send the user to a URL like this: https://www.eventbrite.com/oauth/authorize?response_type=token&client_id=123456789&redirect_uri=http://app.test/eventbriteoath

Then they will send back a parameter to my redirect URI of "?code=abcd" which I can pull and manipulate in my controller.

When I have a user click on my link to the URL, I receive this message from the Eventbrite site:

"The application you're trying to use has made an invalid request to Eventbrite. Please contact the application developer."

I am sure there is something I am doing wrong. Eventbrite API keys are free and pretty straight-forward to get.

What am I missing?

Jul
07
4 months ago
Activity icon

Replied to Best Laravel Drag And Drop For Lists

I know how to Google questions that I have. I wasn't asking "Is it possible to create a drag and drop list in a Laravel app?"

I know it can be done numerous ways. I said so in my original post.

I would rather use something modern like Alpine, but much like this interaction, I have yet to see many people post tutorials or other resources about some of these frameworks.

I am a novice to intermediate developer and highly value the Laracast discussion board for discussions, opinions, and direction, as a developer, not just answers to code questions.

My Googling about JQuery over the past year or so has also brought me to numerous opinions about JQuery starting to "die" and be replaced by "better stuff" due to some of its antiquated methods, older looking UI components, and the fact that Bootstrap 5 will be dropping JQuery and using modern JS for its UI functionality.

So, the seeming sentiment of "Oh, he's a novice, so he should probably just use JQuery" is a much shorter and less deep conversation than I am interested in.

I want to move forward, like an advanced developer would, but I need training resources, and in the ever-changing JS landscape, that is difficult.

Activity icon

Replied to Best Laravel Drag And Drop For Lists

If you are referring to my Livewire Forum post, and if you read it, you will realize that I didn't work anything out.

I found an example presented by @calebporzio that I could not replicate and was not really designed to be a tutorial.

Alpine might be a good solution, but I'm no closer to feeling confident in using it now than I was in April.

Activity icon

Replied to Best Laravel Drag And Drop For Lists

I appreciate your statement, but for this particular function I am looking for someone to share their experience with the ease of using one over the other for this particular functionality.

Activity icon

Started a new Conversation Best Laravel Drag And Drop For Lists

I have a list of DB items. Some of the items are more important. Some less. There is a db field called importance which has a value of either 0 for less, or 1 for more.

In my Laravel view I want to show the list of items with a horizontal (or vertical) line between more important and less important items. Then I need to be able to drag items from one side to the other, changing the db value.

This could probably be done with JQuery, Vue, or Livewire, or maybe even plain JS.

What would you suggest? I am already playing with Livewire in the project and am trying to stay away from the others, but I'm a novice at them all.

Jun
11
5 months ago
Activity icon

Replied to 50% Off PHPStorm

If only I had seen it before it expired. :(

Just saw a Facebook post about it today. The offer ended yesterday, June 10th

Jun
10
5 months ago
Activity icon

Replied to Cashier Issue - No Subscriptions Table

I ran php artisan migrate just for kicks, and it added the stripe columns in my user table, but did not add the subscriptions table as described in the Cashier docs here:

https://laravel.com/docs/7.x/billing

I thought that maybe it never got to that migration due to an error in the past, so I manually deleted the 4 Cashier/Stripe fields in the DB and re-ran php artisan migrate.

This time I received this error: L:\www\Livewire\vendor\laravel\framework\src\Illuminate\Database\Connection.php:464 PDOException::("SQLSTATE[HY000]: General error: 7 Error on rename of '.\livewire#sql-15ac_2b.frm' to '.\livewire\users.frm' (Errcode: 13 - Permission denied)")

Isn't developing fun??? :(

I googled the error and found a few people talking about Foreign Key problems. I have no idea.

Would it be easier to remove Cashier, Push the changes to my Git repo, then do a fresh Laragon, fresh Laravel install, then pull the repo and then try and reinstall Cashier again?

Activity icon

Replied to Cashier Issue - No Subscriptions Table

So... I was able to run composer self-update after adding the line:

openssl.cafile= "C:\laragon\etc\ssl\cacert.pem"

to my php.ini file.

But though I ran composer require laravel/cashier to get the migrations again, they did not show up after the install again. So I removed Cashier and required it again. Then I ran into an error when composer tries to update symfony after I required laravel/cashier again:

Installation failed, reverting ./composer.json to its original content.

[RuntimeException] Could not scan for classes inside "L:\www\Livewire\vendor/symfony/intl/Resources/stubs" which does not appear to be a file nor a folder

I'm thinking about completely reinstalling laragon and a fresh Laravel install, then moving my app over to the new install.

I don't know what to do at this point.

Activity icon

Replied to Cashier Issue - No Subscriptions Table

Good idea, but when I run composer self-update I receive this:

[Composer\Downloader\TransportException] The "https://getcomposer.org/versions" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed Failed to enable crypto failed to open stream: operation failed

self-update [-r|--rollback] [--clean-backups] [--no-progress] [--update-keys] [--stable] [--preview] [--snapshot] [--set-channel-only] [--] []

Jun
07
5 months ago
Activity icon

Replied to Cashier Issue - No Subscriptions Table

Cleared the composer cache. ran require laravel/cashier and received this message:

[Composer\Downloader\TransportException] The "https://repo.packagist.org/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed Failed to enable crypto failed to open stream: operation failed

require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] []...

I turned Windows Defender Firewall off and tried again. No change. Same error.

Btw, I'm running Laragon as my server, in case that helps anything.

Activity icon

Replied to Cashier Issue - No Subscriptions Table

Thanks. Should I remove cashier before trying to require it again, or just run composer require laravel/cashier?

Jun
06
5 months ago
Activity icon

Started a new Conversation Cashier Issue - No Subscriptions Table

Some time ago I installed Cashier, then gave up on my Braintree integration.

Came back and upgraded my Laravel app to 6.0 and continued with trying to use Stripe instead.

Paused my efforts for a bit, came back, and everything was going swimmingly until I tried to create a subscription. I received this error:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'livewire.subscriptions' doesn't exist (SQL: insert into subscriptions (name, stripe_id, stripe_status, stripe_plan, quantity, trial_ends_at, ends_at, user_id, updated_at, created_at) values (Pro, sub_HQ0mXbcjZM4IkC, active, plan_HL5jsx4kxls9W7, 1, ?, ?, 1, 2020-06-06 22:45:09, 2020-06-06 22:45:09))

I then looked to find that there was no "subscriptions" table... so I checked and found there is no migration for that table either. Not sure why this didn't install, though I have moved my app via Laragon a few times.

I figured I would "reinstall" Cashier. But when I run:

composer require laravel/cashier

I get this:

The "https://repo.packagist.org/packages.json" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed Failed to enable crypto failed to open stream: operation failed https://repo.packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date

[Composer\Downloader\TransportException] The "https://packagist.org/p/laravel/cashier%245c4d356393720d50a9e647db17075c43fc310cbb72d4e700636f870c4b9be393.json" file could not b e downloaded: SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed Failed to enable crypto failed to open stream: operation failed

require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-suggest] [--no-update] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] []...

How do I fix this?

May
27
6 months ago
Activity icon

Replied to Javascript Stopped Working

That's a good question, but I haven't updated any libraries on that site. I have only updated a few lines of code from time to time.

Activity icon

Replied to Javascript Stopped Working

We have been using Chrome but I also tried it in Microsoft Edge and nothing happened. We do not have Firefox here in the office.

Activity icon

Started a new Conversation Javascript Stopped Working

I have a Laravel app that has a credit card payment page. This page has been working fine for months now. It was even used twice this morning and it worked just fine.

Suddenly, when a user goes to click the "Submit Payment" button, the page does nothing. I have console.log commands within the Javascript to help me see what is happening, but they aren't all firing, plus the only 2 that are firing seem to be happening in the wrong order.

I haven't changed any of the code in this app in a couple of months. I checked with Braintree, my credit card processor and they aren't having problems or seeing my requests. I checked with my VPS company to see if they made any updates or see any errors on their end and they see nothing.

What could cause Javascript to be working one minute and suddenly not working the next?

EDIT: I have tried Chrome and Microsoft Edge