wilburpowery

wilburpowery

Alajuela

Hire Me

Member Since 2 Years Ago

Experience Points 89,520
Experience
Level
Lessons Completed 615
Lessons
Completed
Best Reply Awards 40
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.

07 Nov
1 month ago

wilburpowery left a reply on Samsung Phone

Pretty sure it's the version of your web browser. Jeffrey might be using something that isn't supported by the version of your mobile browser.

31 Oct
1 month ago

wilburpowery left a reply on Add Markdown Editor To Textarea

You can use a package like Trix from basecamp to use Markdown editors.

https://github.com/basecamp/trix

There's a bunch of editors you can use. I just find Trix super simple.

22 Oct
1 month ago

wilburpowery left a reply on Counting Clicks In Laravel

$video->increment('total_clicks');

the increment() method takes in a column name and increments it by one.

https://laravel.com/docs/5.7/queries#increment-and-decrement

wilburpowery left a reply on View Composers - Composer Class Not Found

Can't really understand your code. But can you try running in your terminal:

composer dump-autoload
19 Oct
1 month ago

wilburpowery left a reply on “Class 'Maatwebsite\Excel\Facades\Excel' Not Found” Problem

composer require maatwebsite/excelshould install the package for you.

wilburpowery left a reply on “Class 'Maatwebsite\Excel\Facades\Excel' Not Found” Problem

Did you install the Laravel Excel package with composer?

If so, and you aren't using Laravel 5.5 or greater, you'll have to manually add the Service Provider and Facade in config/app.php.

Versions of Laravel prior to 5.5 don't have the Package Auto Discovery feature.

18 Oct
1 month ago

wilburpowery left a reply on Dom Dosen't Refresh, What Wrong ?

If you have your code in a repo, I'd be willing to take a look at it and help you out. You can just share the link if you do have it.

wilburpowery left a reply on Dom Dosen't Refresh, What Wrong ?

You need to accept the post as a parameter in the handlePostEvent() method.

handlePostEvent(post) {
    this.posts.push(post);
}

wilburpowery left a reply on Dom Dosen't Refresh, What Wrong ?

Can you remove the JSON.parse statement?

From the Vue Dev Tools I can see posts isn't an actual object but it's a JSON string.

try removing that and let's see if it works.

Also, you don't need to use the this keyword inside the<template> of a component.

wilburpowery left a reply on Dom Dosen't Refresh, What Wrong ?

Can you see the post being added to the posts object using the Vue Devs Tools?

wilburpowery left a reply on Dom Dosen't Refresh, What Wrong ?

Why are you using the global event approach when a simple $this->emit('posted', {data}) since it's a parent/child event.

So in theory you can update your code to something like this:

// you can update your newpost.vue component to emit the event this way
}).then((response)=>{
    this.$emit('posted',response.data)
})


// on the posts.vue component you can listen for the event this way

<NewPost v-if="newpost" :user_id="this.user_id" @posted(handlePostedEvent)></NewPost>
17 Oct
1 month ago

wilburpowery left a reply on Is There A Way To Validate Blade Syntax

Can you try to run it through the Blade compiler and catch if any exceptions are thrown?

Never really tried something like this tbh ?

wilburpowery left a reply on AWS Deployed App - Viewing The Site?

If you do a ping mydomain.com from a terminal do you get the same IP from your AWS console? Maybe the DNS hasn't propagated completely yet. You sometimes might have to wait up to 24 hours.

16 Oct
1 month ago

wilburpowery left a reply on Manually Trigger Email Verification Mail To New User In 5.7

Yeah. $request->user() returns the currently authenticated user.

Glad I could help :)

wilburpowery left a reply on Manually Trigger Email Verification Mail To New User In 5.7

The Illuminate\Auth\MustVerifyEmail trait has a sendEmailVerificationNotification method which you can use.

So you can have something like this:

$user->sendEmailVerificationNotification(); // $user is the newly created user.
12 Oct
2 months ago

wilburpowery left a reply on Admin Package

Voyager is free!

Laravel Nova isn't free.

11 Oct
2 months ago

wilburpowery left a reply on Don't Install Illuminate/support V5.5.0|don't Install Laravel/framework V5.3.31

What version of Laravel are you using?

Seems like conflicting versions of the illuminate/support package is happening.

wilburpowery left a reply on Using Blade Directives Messes Up Final Code Indentation - Is This Normal?

However the html looks in the browser doesn't affect your site or app in any way. Each browser parses html differently.

Once the code looks good in the editor, you're good.

Don't sweat it brother! Keep up the work.

wilburpowery left a reply on Admin Package

Voyager uses Bootstrap 3.

If you're main app uses Bootstrap 4 I shouldn't be a problem either since you would not load any of your main app styles in the admin side anyways.

If you're up for it, maybe give Laravel Nova a try?

It's 99$ but totally worth it for me.

10 Oct
2 months ago

wilburpowery left a reply on File Attachment Module

The Media Library by Spatie is pretty good for this.

https://github.com/spatie/laravel-medialibrary

wilburpowery left a reply on Validation Rule, Field Must Not Contain A Pipe |

A custom validation rule?

https://laravel.com/docs/5.7/validation#custom-validation-rules

And then you can simply do a strpost check to find any | in the string passed in.

08 Oct
2 months ago

wilburpowery left a reply on Hitting 403 Page When Clicking Verify Link In Email Using New Laravel Verification (5.7)

The Email verification feature in Laravel uses the new Signed Routes feature introduced in 5.7.

Maybe that could be an issue also? It would make sense since you're getting a Forbidden error, so maybe the signed route isn't being validated correctly?

I'm just guessing right now to be honest. : /

wilburpowery left a reply on Best Practice To Secure Laravel End Points

Laravel comes out of the box with a lot of security features that protect you against the most common attacks like SQL Injection and Cross Site Request Forgery.

Laravel doesn't have this concept of plugins, you might be mistaking it with Wordpress or something similar.

wilburpowery left a reply on Anchor Tag Routing

Create a route for each form?

Like:

Route::post('form-1', '[email protected]');
Route::post('form-2', '[email protected]');

And simply add each route to the action on the forms.

wilburpowery left a reply on Hitting 403 Page When Clicking Verify Link In Email Using New Laravel Verification (5.7)

Haven't really faced anything similar, but I don't really use Heroku.

Might it be something particular to Heroku?

I use Laravel Forge and have email verification working on about 3 live apps right now.

03 Oct
2 months ago

wilburpowery left a reply on Laravel Framework Version 5.6.38 - Code Review Using Static Analysers.

The best version to start with is the latest one. 5.7.

These Static analyzers are super opinionated, I wouldn't sweat over those results.

I encourage you to take a look at the code behind Laravel and you'll see how beautiful and expressive it is.

02 Oct
2 months ago

wilburpowery left a reply on Routes - Invocation Parameter Types Are Not Compatible With Declared

Can you please format your code a little better?

I think it's simply an error in your code, but it's hard to see with how you pasted it right now.

wilburpowery left a reply on FCC Responsive Web Tribute Page

Looks grat @James_Moore. Keep up the good work. It only get's easier.

As for your HTML, in codepen you don't need to have the basic html structure.

For example:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    
</body>
</html>

The above markup isn't needed in codepen. It adds it for you automatically.

You could get away with simply adding your html content:

<h1>My content</h1>
<p>my paragraph</p>
01 Oct
2 months ago

wilburpowery left a reply on Error In Make Controller

You have something wrong in your routes file.

Before registering any routes in the file, you need to generate the controller first.

Maybe check you're not doing this?

30 Sep
2 months ago

wilburpowery left a reply on Call To Undefined Method Illuminate\Database\Query\Builder::makeAllSearchable() Laravel Scout Algolia

Indeed. Glad I could help. Maybe mark as best answer in case anyone else finds this question?

wilburpowery left a reply on Pay Forge With Paypal

Not supported that I know of.

wilburpowery left a reply on Call To Undefined Method Illuminate\Database\Query\Builder::makeAllSearchable() Laravel Scout Algolia

Are you using the Searchable trait in the rest of models?

use Laravel\Scout\Searchable;

25 Sep
2 months ago

wilburpowery left a reply on Sending Email Via Mailtrap Not Working And Not Error

Nothing in the storage/logs/laravel.log file? If not, maybe you haven't added your Mailtrap credentials correctly in your .env file.

wilburpowery left a reply on Blade Null Coalesce Doesn't Work

The or helper is been removed in 5.7.

You should use the Null Coalesce Operator: ??

So you'll be left with {{ $title ?? 'Default page title' }}

24 Sep
2 months ago

wilburpowery left a reply on Redirection, LoginController Vs RedirectIfAuthenticated

If you want to redirect somewhere after you login to your application, the redirectTo property is the way to go.

The RedirectIfAuthenticated middleware is simply what's used when you assign a route the guest middleware. So If you visit a route that is only intended for guest users, like the login route, it will redirect you back to the home route.

20 Sep
2 months ago

wilburpowery left a reply on Reactjs & Laravel - Syntax Error, Whiile Combining React With Laravel.

Please format the code properly. Can't event begin to understand it.

wilburpowery left a reply on CSS Grids For Everyone - Why It 'Tooling' Category?

Does it really matter that much though?

wilburpowery left a reply on What About A Laravel 5.7 From Scratch Series?

Jeff typically records this series in January. Patience is key!

wilburpowery left a reply on How To Control User Dashboard

You can always add some @if blade constraints in the templates.

Like:

@unless(auth()->user()->isOfficer())
    <li>Menu not visible to an office user</li>
@endunless

Also, you should do some validation on the backend using policies to prevent an office user to let's say visit a route to create a user.

https://laravel.com/docs/5.7/authorization#writing-policies

19 Sep
2 months ago

wilburpowery left a reply on Make:Auth

Yep. What @Cronix said. You should know how you have your roles structured.

wilburpowery left a reply on On Moving Laravel Projects From One PC To Other PC. It Gives Too Many Redirects.

So it works on one PC but when moved to the other one it redirects to many times?

Or it redirects to many times on either PC?

wilburpowery left a reply on How Can I Display The Relation Data In Vue.js

Is this with Laravel or vanilla PHP?

wilburpowery left a reply on Pros And Cons Of Laravel Dusk Vs. Ghostinspector.com

Honestly I think Dusk is more developer focused/friendly. You have a lot more control over your testing, whereas using a service per say, you're limited to whatever they offer.

wilburpowery left a reply on Make:Auth

Or, you can also override in your LoginController.php the +authenticated+ method which receives the $request and the $user.

protected function authenticated(Request $request, $user)
{
    if($user->isAdmin()) {
            return redirect('/admin-route');
        }

        return redirect('/home'); 
}

^ This is what I would do personally.

wilburpowery left a reply on Make:Auth

in the login controller there's a protected $redirectTo property. But in your case you can delete that and create a function.

public function redirectTo()
{
    if($user->isAdmin()) {
        return '/admin-route';
    }

    return '/home'; 
}
18 Sep
2 months ago

wilburpowery left a reply on Put Multiples Fields In One Row

If not, simply adding the input should work. Not sure I understand your question though.

wilburpowery left a reply on Put Multiples Fields In One Row

Are you using a css framework like Bootstrap?

They have an form-inline class I think.