WallyJ

WallyJ

Member Since 2 Years Ago

Experience Points
8,820
Total
Experience

1,180 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
8,820 XP
Mar
25
1 week ago
Activity icon

Replied to Livewire Component's Public Property Must Be Of Type: [numeric, String, Array, Null, Or Boolean]. Only Protected Or Private Properties Can Be Set As Other Types Because JavaScript Doesn't Need To Access Them.

I understand that I can still paginate, but even if I take the

->paginate()

out of the controller, I still get the error. The error does not have to do with pagination.

Mar
21
1 week ago
Activity icon

Replied to Livewire Component's Public Property Must Be Of Type: [numeric, String, Array, Null, Or Boolean]. Only Protected Or Private Properties Can Be Set As Other Types Because JavaScript Doesn't Need To Access Them.

So I learned that it was an issue with my Livewire version. So I updated. Then all was well..

Then the issue came up again, so I checked the release notes for Livewire. https://github.com/livewire/livewire/releases

It became an issue again so Caleb fixed it again in release 1.0.9.

So I updated Livewire again.

Now I still get the error message. :(

Mar
18
2 weeks ago
Activity icon

Replied to Installing Font-Awesome To Laravel Via Composer

I'm going to skip the install, though I already installed it... and just use the script tag after I create an account with font-awesome on their website. Thanks all!

Activity icon

Started a new Conversation Installing Font-Awesome To Laravel Via Composer

I installed Font-Awesome using the command:

composer require components/font-awesome

in my project folder.

It was successful. I went to use it and it didn't work. Then I thought.. Oh... I need to reference the CSS (which is not in the Font-Awesome docs or the packagist instructions at https://packagist.org/packages/components/font-awesome

So I read tried to reference the CSS file in the vendor folder but that didn't work. Then I read in the docs about publishing vendor assets to the public folder, which seems to have to be done every time the package might update.

Not sure if that is true, but that doesn't make sense. We are in 2020 people. Back in the old days we downloaded a CSS file to update in our apps and it was already referenced. We just downloaded it into the right folder. What is the point of a package manager like composer if it doesn't really update the files we need to use??

Sorry for the rant. All help is appreciated.

Mar
12
2 weeks ago
Activity icon

Awarded Best Reply on Laravel - Composer Update To 7.0 - Now 500 Error

Ok. I have checked the guide, and I did not follow the section found here: https://laravel.com/docs/7.x/upgrade#symfony-5-related-upgrades

about Symfony upgrades, so I fixed those.

Now I get an error about:

Call to undefined method Livewire\LivewireManager::assets()

Gotta research that now.

EDIT: That is Livewire syntax that I think changed. Going to check on that syntax now.

EDIT2: That was it. Changed that code and we are up and running. :)

Activity icon

Replied to Laravel - Composer Update To 7.0 - Now 500 Error

Ok. I have checked the guide, and I did not follow the section found here: https://laravel.com/docs/7.x/upgrade#symfony-5-related-upgrades

about Symfony upgrades, so I fixed those.

Now I get an error about:

Call to undefined method Livewire\LivewireManager::assets()

Gotta research that now.

EDIT: That is Livewire syntax that I think changed. Going to check on that syntax now.

EDIT2: That was it. Changed that code and we are up and running. :)

Mar
11
3 weeks ago
Activity icon

Awarded Best Reply on Mailgun Using Sandbox, But I Have Production Domain And Key

Ok everyone... So in an effort to double-check everything I went back through my .env, services config and mail config... and it hit me...

I had 2 sections for mailgun in my services.php file: The first one was like this:

'mailgun' => [
        'domain' => env('MAILGUN_DOMAIN'),
        'secret' => env('MAILGUN_SECRET'),
    ],

which is correct, BUT the second one was hard-coded with the sandbox info, which is what was read last and used.

I must have been copy/paste happy when I was first setting it up and when I was still sandboxing that was fine. But then in production... not so much.

All is well.

Activity icon

Replied to Mailgun Using Sandbox, But I Have Production Domain And Key

Ok everyone... So in an effort to double-check everything I went back through my .env, services config and mail config... and it hit me...

I had 2 sections for mailgun in my services.php file: The first one was like this:

'mailgun' => [
        'domain' => env('MAILGUN_DOMAIN'),
        'secret' => env('MAILGUN_SECRET'),
    ],

which is correct, BUT the second one was hard-coded with the sandbox info, which is what was read last and used.

I must have been copy/paste happy when I was first setting it up and when I was still sandboxing that was fine. But then in production... not so much.

All is well.

Activity icon

Replied to Mailgun Using Sandbox, But I Have Production Domain And Key

Do you mean using the 'curl' examples?

Activity icon

Replied to Mailgun Using Sandbox, But I Have Production Domain And Key

I thought maybe it was a cached config in Laravel so I ran php artisan config:clear but that had no effect.

Activity icon

Replied to Mailgun Using Sandbox, But I Have Production Domain And Key

I am not using either of those. I simply created a route that is called by a URL, and I am currently testing that route by manually going to the URL in a browser to send the email.

I was going to set up a cron job on the server to visit the URL once a day to run the function.

Activity icon

Started a new Conversation Mailgun Using Sandbox, But I Have Production Domain And Key

I followed the docs at https://laravel.com/docs/5.8/mail

and set up Mailgun working perfectly through the sandbox, sending emails as developed.

Moved to production, added my domain to mailgun. Set up the MX records, etc. Under the DNS section at Mailgun, all the settings have green checkmarks.

The mailgun domain is set to my domain, not the sandbox, and the secret is set to the correct key.

I sent an email programatically. It went through, but was sent through the sandbox, not the production domain.

I don't understand how this is possible.

Mar
10
3 weeks ago
Activity icon

Replied to Updated From 6.* To 7.0

@edtheduck Can you explain precisely what you missed and how you fixed it? I have the exact same error in my console. Thanks!

I followed the instructions at: https://laravel.com/docs/7.x/upgrade#symfony-5-related-upgrades

, ran composer update again, but still get the error.

Mar
09
3 weeks ago
Activity icon

Started a new Conversation Laravel - Composer Update To 7.0 - Now 500 Error

I updated to Laravel 7.0, following the instructions concerning dependencies in the docs:

Now every page of my app I try to load I get a "HTTP ERROR 500"

I also received this error after running "composer update":

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255

I tried to run composer dump-autoload, but received the same error.

Tried removing the vendor directory and ran composer update again. Same outcome.

Cleared the composer cache and ran the update again to get fresh files, but still get the 500 Error.

Running on Laragon on my local machine.

Activity icon

Replied to Route Works To Show Correct URL, But Get 404

That is a bit non-descript. I have seen multiple tutorials on how to do this to have the web root above the other project files. I know that it is an issue of security, but I need to be able to place my project files in such a way that they work.

Natively, the "public" folder cannot be dropped into the "public_html" folder and it work correctly. And not all VPS's have access to change their Apache config files.

As always, @snapey , I appreciate your input. :)

Activity icon

Started a new Conversation Livewire Component's Public Property Must Be Of Type: [numeric, String, Array, Null, Or Boolean]. Only Protected Or Private Properties Can Be Set As Other Types Because JavaScript Doesn't Need To Access Them.

I'm receiving the following error:

Livewire component's [contactshow] public property [contactnotes] must be of type: [numeric, string, array, null, or boolean]. Only protected or private properties can be set as other types because JavaScript doesn't need to access them.

I can't tell what I'm doing wrong. Here's my code:

Livewire Controller:

<?php

namespace App\Http\Livewire;

use Livewire\Component;
use App\Task;

class Contactshow extends Component
{

    public $contacts;
    public $tasktext;
    public $dealId;
    public $taskduedate;
    public $deal_id;
    public $contactnotes;

    public function mount($contacts)
    {
        $this->contacts = $contacts;
        $this->contactnotes = $this->contacts->contactnotes()->paginate();
    }

    public function render()
    {
        return view('livewire.contactshow');
    }

}

Livewire Component View:

<div class="row">
   <div class="col-md-12">
      <ul class="list-group">
         @foreach($this->contactnotes as $contactnote)
            <li class="list-group-item">
               {{$contactnote->created_at}} - {{$contactnote->contactnotetext}}
            </li>
         @endforeach
      </ul>
   </div>
</div>
Activity icon

Replied to Route Works To Show Correct URL, But Get 404

Side note. I figured out that it is only a problem with the VPS temporary URL. Once the domain is pointed it works just fine.

Why is that?

The temp URL looks like: www.hostingcompany.com/~username

I think it's the username folder/redirect that messes up Laravel.

Activity icon

Replied to Route Works To Show Correct URL, But Get 404

Don't you need to set the APP_URL in the .env?

I have placed all of my app files into a subdirectory (myapp) in the root (same level as public_html), so I have to change two lines in index.php, right:

require __DIR__.'/../myapp/vendor/autoload.php';

$app = require_once __DIR__.'/../myapp/bootstrap/app.php';
Mar
06
3 weeks ago
Activity icon

Started a new Conversation Route Works To Show Correct URL, But Get 404

I moved a site to a new server, and now when I visit the site URL, it automatically takes me to www.site.com/login as the route is designed, but then I get a 404.

I thought I adjusted to .env and index.php files correctly for the directory structure and new site address.

Is there another file I should edit?

Activity icon

Replied to Deployment Of Laravel App To VPS

I've also ready about using mod rewrite to perform a 301. Would that have the same effect or not?

Mar
03
4 weeks ago
Activity icon

Replied to Deployment Of Laravel App To VPS

Nothing, besides create the account. Which, the standard CPanel account has a default folder structure that looks something like this:

(/home/coolapp)

.cpaddons

.cpanel

.cphorde

.htpasswds

.imh

.spamassassin

.ssh

.trash

etc

logs

mail

perl5

public_ftp

public_html

ssl

tmp

wordpress-backups

where "coolapp" is the name of the account created in WHM and where "public_html" sits in the root folder.

My understanding is that, since the public_html folder is public facing, that the root folder should hold all app files, .env, etc. so that the public can't reach them, but the app can, and that the public_html folder acts as the Laravel "public" folder, but I'm sure something needs to be done for that to work.

Activity icon

Started a new Conversation Deployment Of Laravel App To VPS

I am about to deploy a Laravel App to a VPS. The app will live on a subdomain and a separate account for the subdomain has been created via WHM, so it has it's own CPanel and directory structure.

My question is: Where do I upload all of the files?

Do I treat the project "public" directory like the "public_html" directory on the server and place all files and subfolders accordingly?

And if so, does the app treat the names "public" and "public_html" the same?

Mar
02
4 weeks ago
Activity icon

Started a new Conversation Vue View Delays In Showing Updated DB Info

I have created a Laravel app that has one view that uses Vue to perform an instant search as you type.

But when my users type, they get the main results correctly, but each row has a value attached to the main result via a relationship that does not show correctly.

I wondered if Vue does caching of any kind. Sorry for the novice question without code. I can add my code but thought someone might go "Oh... that happens sometimes when..."

Thanks.

Mar
01
1 month ago
Activity icon

Replied to Livewire Pagination, Using Mount()

That makes sense. I learned so much about relationships that I try to make it work with everything. :)

Thanks for clarifying.

Activity icon

Replied to Livewire Pagination, Using Mount()

I was using eloquent relationships to bring in the contact notes. But it seems that you can’t paginate off of a relationship, only from a query. Is that correct?

Feb
29
1 month ago
Activity icon

Replied to Livewire Pagination, Using Mount()

This is for a Contacts view, showing the comments as a collection. One contact on this particular view.

Activity icon

Replied to Livewire Pagination, Using Mount()

Trying to paginate the contact notes

Feb
28
1 month ago
Activity icon

Started a new Conversation Livewire Pagination, Using Mount()

I have followed the instructions in the docs here: https://laravel-livewire.com/docs/mount-method/

to get the results I want from my DB.

Livewire Controller

<?php

namespace App\Http\Livewire;

use Livewire\Component;
use App\Task;
use App\Contact;
use App\Contactnote;

class Contactshow extends Component
{

    public $contacts;
    public $tasktext;
    public $dealId;
    public $taskduedate;
    public $deal_id;

    public function mount($contacts)
    {
        $this->contacts = $contacts;
    }

    public function render()
    {
        return view('livewire.contactshow');
    }

}

View section of results:

<div class="col-md-12">
        <ul class="list-group">
            @foreach($this->contacts->contactnotes->sortByDesc('created_at') as $contactnote)
            <li class="list-group-item">
           {{$contactnote->created_at}} - {{$contactnote->contactnotetext}}
           </li>
            @endforeach
       </ul>
</div>

Results currently show correctly.

Now I want to paginate the results, but the paginate example in the docs:

https://laravel-livewire.com/docs/pagination/

does not use the mount() command in their example, so I am a bit confused. Not sure how to paginate at this point still using mount().

Feb
27
1 month ago
Activity icon

Replied to Click Back Button In Browser, View Shows Data With No Formatting

The admin page is technically a Vue component, so that could be the issue.

Activity icon

Started a new Conversation Click Back Button In Browser, View Shows Data With No Formatting

I have a view with url "/admin". When I go there it shows a list of users.

I can click on a user's name and it takes me to the user edit view with url - "/admin/edituser/105" (or whatever user id)

This works great... unless I click the Back button on my browser from the user edit view.

Then it takes me to the correct url - "/admin", but I only see data that looks like:

{"user":{"id":108,"type":"admin","...... etc.

Essentially all the data that should be in the view.

If I reload the page it shows correctly, or if I click a link in the menu that goes to the "/admin" url, it works as expected.

Why would my Back button not load the view properly?

Activity icon

Awarded Best Reply on "No Input File Specified" On NGINX Server In Production

Actually, I found the issue in my .htaccess.

The "RewriteBase" line was from an old hosting company with a different subfolder structure. Also the "RewriteRule" line with the directory listed needed to be updated as well. Thanks all!

Activity icon

Replied to "No Input File Specified" On NGINX Server In Production

Actually, I found the issue in my .htaccess.

The "RewriteBase" line was from an old hosting company with a different subfolder structure. Also the "RewriteRule" line with the directory listed needed to be updated as well. Thanks all!

Activity icon

Replied to "No Input File Specified" On NGINX Server In Production

It's a VPS. So I believe I have admin rights to a certain degree.

Also, as a side note, when you go to the subdomain (which points to the subfolder), it redirects to immediately login, which works. I see app.domain.com/login in the browser URL, but still get the error.

Activity icon

Replied to "No Input File Specified" On NGINX Server In Production

EDITED: Also, this is my .htaccess file:


# BEGIN WordPress
<IfModule mod_expires.c>
    ExpiresActive On
    ExpiresByType image/jpg "access plus 1 year"
    ExpiresByType image/jpeg "access plus 1 year"
    ExpiresByType image/gif "access plus 1 year"
    ExpiresByType image/png "access plus 1 year"
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType application/pdf "access plus 1 month"
    ExpiresByType text/javascript "access plus 1 month"
    ExpiresByType text/html "access plus 5 minutes"
    ExpiresByType image/x-icon "access plus 1 year"
    ExpiresDefault "access plus 6 hours"
</IfModule>
<ifModule mod_headers.c>
Header set X-Endurance-Cache-Level "2"
</ifModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /~docuclub/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /~docuclub/index.php [L]
</IfModule>
# END WordPress

# BEGIN cPanel-generated php ini directives, do not edit
# Manual editing of this file may result in unexpected behavior.
# To make changes to this file, use the cPanel MultiPHP INI Editor (Home >> Software >> MultiPHP INI Editor)
# For more information, read our documentation (https://go.cpanel.net/EA4ModifyINI)
<IfModule php7_module>
   php_flag display_errors Off
   php_value max_execution_time 120
   php_value max_input_time 60
   php_value max_input_vars 1000
   php_value memory_limit 256M
   php_value post_max_size 260M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php72"
   php_value upload_max_filesize 256M
   php_flag zlib.output_compression Off
</IfModule>
<IfModule lsapi_module>
   php_flag display_errors Off
   php_value max_execution_time 120
   php_value max_input_time 60
   php_value max_input_vars 1000
   php_value memory_limit 256M
   php_value post_max_size 260M
   php_value session.gc_maxlifetime 1440
   php_value session.save_path "/var/cpanel/php/sessions/ea-php72"
   php_value upload_max_filesize 256M
   php_flag zlib.output_compression Off
</IfModule>
# END cPanel-generated php ini directives, do not edit

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php73” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php73 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
Activity icon

Replied to "No Input File Specified" On NGINX Server In Production

I don't know anything about Nginx, and where to show the document root, or what I would change in the .htaccess file.

@sinnbeck , I don't know where to find a site config in nginx, and I said my dev server was LAMP, but my production is Nginx (LNMP)

Also, again, the main site is working fine. Only the subdirectory is giving me an error.

Feb
26
1 month ago
Activity icon

Started a new Conversation "No Input File Specified" On NGINX Server In Production

Symptoms:

Moved a dev Laravel site from a LAMP dev server to a run in a subdirectory on an NGINX web server on the web.

Now getting "No input file specified" in text on a white page.

I googled the issue and most answers deal with Homestead.yaml files. This is not the case for me. No homestead on dev or prod.

Ideas?

I'm sure it's a setting, and probably an NGINX issue.

By the way, a WordPress site is installed in the root of the site, and it runs fine. Just the subdirectory with the Laravel app gives me the error.

Feb
24
1 month ago
Activity icon

Started a new Conversation Stripe - Cashier, Or No Cashier

I am getting ready to add Stripe to a project for the first time. My understanding is that I can use Laravel Cashier for this, but I have seen where others skip Cashier and do a straight integration as described in the Stripe docs.

Can you share with me your choice, and your experience with that choice?

I'm using Laravel 6.0 for this project.

Feb
21
1 month ago
Activity icon

Replied to Livewire Not Refreshing Data After Wire:Change

Yes, Snapey. It did. I was able to use his last suggestion to fix the issue. Though I am still not sure why the tutorial code worked for that person, but mine had to be adjusted to work.

Feb
19
1 month ago
Activity icon

Replied to Bcrypt List Of Existing Text Passwords

I believe I found the php.ini section to up the limit. Trying again now.

UPDATE: That did the trick! All the passwords were hashed. Just tested a user account and was able to login!

Thanks!

Activity icon

Replied to Bcrypt List Of Existing Text Passwords

That fixed it. It ran.

But I still received the error:

Maximum execution time of 30 seconds exceeded

Activity icon

Replied to Bcrypt List Of Existing Text Passwords

I ran the controller again, but got a white screen and the DB didn't change.

Activity icon

Replied to Bcrypt List Of Existing Text Passwords

Yep. Deleted all users and re-imported. :)

Activity icon

Replied to Bcrypt List Of Existing Text Passwords

Gotcha. Is this the right syntax to chunk my function?:

public function hashpasswords() 
    {
        $users = \App\User::all()->chunk(50, function ($users) {
            foreach ($users as $user) {
            $user->password = Hash::make($user->password);
            $user->save();
            }
        });
    }
Activity icon

Replied to Bcrypt List Of Existing Text Passwords

Interesting. I added the slash, and it worked, though I receive this error "Maximum execution time of 30 seconds exceeded", so I'll have to use chunking I guess.

Though the documentation for 5.8 shows the use of App\User with no slash: https://laravel.com/docs/5.8/eloquent-collections

Activity icon

Replied to Bcrypt List Of Existing Text Passwords

I changed my code to this, to use Eloquent, but now I'm getting the following error:

Class 'App\Http\Controllers\App\User' not found

Controller:

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\User;
use Auth;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
use Braintree_Gateway;
use Artisan;

class AdminController extends Controller
{
public function hashpasswords() 
    {
        $users = App\User::all();
            foreach ($users as $user) {
            $user->password = Hash::make($user->password);
            $user->save();
            }
    }
}
Activity icon

Replied to Bcrypt List Of Existing Text Passwords

Umm... I'm getting the followinng error:

Call to undefined method stdClass::save()

on the line:

$user->save();

I'm guessing that $user is an object, not an Eloquent model, so I can't use save() unless I change the code to use App\User::