Member Since 2 Years Ago

Experience Points

4,730 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
Best Reply Awards
Best Reply
  • start-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-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-token Created with Sketch.


    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.


    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist 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 1
270 XP
2 months ago
Activity icon

Replied to How To Run Events After User Verification

User model

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Contracts\Auth\MustVerifyEmail;

class User extends Authenticatable implements MustVerifyEmail
    use HasApiTokens,Notifiable;

// dozens of orm rel methods here...

At the top of my web.php routes file

Auth::routes(['verify' => true]);

Artisan route:list says

    | GET|HEAD  | email-verification/check/{token}                 | email-

verification.check | App\Http\Controllers\Auth\[email protected] rification | web,guest |

I have this property in my VerificationController:

protected $redirectTo = '/home';

And it does attempt visiting that link, showing the scaffolding indeed works

In my eventsServiceProvider, I have

    protected $listen = [
        'App\Events\Event' => [
        'Illuminate\Auth\Events\Verified' => [

I ran the make:event command and it created that event for me in that directory, which I have edited to transport my data of choice to the listener. However, logging anything inside the event or listener has no effect. The db call I intend to make inside it is not being inserted.

in LogVerifiedUser, I have

    public function handle(Verified $event)
        $user = $event->user;

        // use the data's properties

In the event itself, we have

class Verified
    use Dispatchable, InteractsWithSockets, SerializesModels;

    public $user;

     * Create a new event instance.
     * @return void
    public function __construct(\App\User $user)
        $this->user = $user;

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

Do tell if there's another bit of the app you may be interested in. Many thanks

Activity icon

Started a new conversation How To Run Events After User Verification

I've followed all the instructions at https://laravel.com/docs/5.8/verification , as well as a few tutorials on the topic, but for the life of me, the events never fire! Indeed, I have inspected the getVerification method that handles the verification route, and no such event is fired in it. Am I supposed to invoke the method's parent in an override and then dispatch my desired event inside that? I imagine it should work, even though I've not tried it yet -- the reason for this hesitance being that if I ought to manually dispatch that event, at least one of the tutorials will have hinted at or mentioned it. Is the event fired somewhere I happen to have missed or am I free to invoke?

2 years ago
Activity icon

Replied to How To Auth With Laravel 5.4

OOP paradigms are the same everywhere. I finished the Java text I was studying and kept wondering if it was the same language people moan about. But that was because I've done stuff with OOP PHP. My problem (I think) with Java is my laziness (tsk) to master the method names and what library is in what package. I need a lot more projects that would screw me over in it but I've been too lazy lately. I think since the Laravel saga, I've been shook.

Activity icon

Replied to How To Auth With Laravel 5.4

Good news. Can we rendezvous outside Laracast? I'm eagerly looking to spread my wings towards usable Java. Be it enterprise or what have you. I could use some insights and discussions to remain in the loop. What say thee??

Activity icon

Replied to How To Auth With Laravel 5.4

@jlrdw Laziness? You're just a few more framework agents away from getting lynched. In Laravel's case, there isn't much benefits besides the auth (if it works). PHP isn't a verbose language anyway. The function names are pretty short and method names for their OOP paradigm are intuitively sane. Compare that with C#. I wrote an article on this in a not too distant past. The only tangible benefit from that earlier URL I agree with is maintainability. The rest of what they offer can be written in a few lines. But that's not why we're here.

@snapey easy there. You're starting to come off as brutishly skewed. The entry point of most applications is the login channel. Intuitively that's where you progress from into the innards of the program. If your auth isn't working, how then do you test alternate markup or similar functionality?

2 years ago
Activity icon

Replied to How To Auth With Laravel 5.4

Nope I haven't. I heard it's the easiest/most modern language out there so it'll take some time before I look that way.

I never said or inferred I'm better than anybody. And you're not correct about nobody forcing me to use the framework. It is on every single PHP job listing requirement. I have no choice except to suffer like this.

I haven't even set up shop. I barely just got the ball rolling by forfeiting my table. But I cannot log out. I can imagine how streamlined and fun development proper will be.

Activity icon

Replied to How To Auth With Laravel 5.4

I removed it initially when I saw that error the 1st time. After running make:auth, new views were generated with their default values (which included that csrf token BTW). So it's there. But back when I removed it and kept getting the same errors, what I did was copy the token lying in the form and pasting it in the Head token.

That's the problem with using motley code written by strangers. When something goes wrong, you neither know what to touch nor where to go except rely on "community". Community is invisible like renegade militants. Nobody is really responsible for your problems and you're at their mercy like I've been these past weeks. This whole process felt like learning programming afresh--it took me back to those horrendously dreadful days when I'd be stuck on one problem for weeks and none of those I looked up to would help. Several years later, I haven't encountered a problem on the web that defied a day of me scraping at. But here I am, getting screwed in every single hole by Laravel just because.

Activity icon

Replied to How To Auth With Laravel 5.4

I've seen the difference. How am I supposed to know about how both code bases are different when I've been following your orders of letting default auth take control? Anyway I've manually changed that line to "id" and now the error I'm getting is TokenMismatchException in VerifyCsrfToken.php line 68:. I copied all the code from that github file you sent into mine just to remove any other differences but it still throws the same error.

2 years ago
Activity icon

Replied to How To Auth With Laravel 5.4

It's not different. I said line 46 not 34.

You reference a non-existent column name - hence the error.

How is this possible when I'm not calling or invoking anything? What's the column name I'm referencing?

Activity icon

Replied to How To Auth With Laravel 5.4

No sir. Thread title says the OP is using version 5.4. That would mean he's on the most recent version.

Activity icon

Replied to How To Auth With Laravel 5.4

File location: C:\wamp64\www\laravel\vendor\laravel\framework\src\Illuminate\Auth\GenericUser.php

Contents: https://gist.github.com/nmeri17/304ce0f60c01acc3cf2cba0a76e3390d

2 years ago
Activity icon

Replied to How To Auth With Laravel 5.4

Done. That worked to a certain degree: I wasn't sent an email when I tried signing up. Then why I tried logging out, I got this

ErrorException in GenericUser.php line 46: Undefined index: username

Googled a bit for a solution to that without success.

Activity icon

Replied to How To Auth With Laravel 5.4

C:\wamp64.2\www\laravel>php artisan migrate Migration table created successfully.

[Illuminate\Database\QueryException] SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' alre ady exists (SQL: create table users (id int unsigned not null auto_incr ement primary key, name varchar(255) not null, email varchar(255) not n ull, password varchar(255) not null, remember_token varchar(100) null, created_at timestamp null, updated_at timestamp null) default character set utf8mb4 collate utf8mb4_unicode_ci)

[PDOException] SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' alre ady exists

@Snapey What's the next step sir?

The preexisting table there is belongs to the application I'm trying to rebuild with laravel so a fresh table is unacceptable--the columns contain data I imported from the old table.

Activity icon

Replied to How To Auth With Laravel 5.4

its because we can follow guidance.

Lol. OK.

many of the written tutorials that are out there.

You're going to recommend one I can use to sign in right? I mean, that's the whole point of the thread no?

Activity icon

Replied to How To Auth With Laravel 5.4

@Hawkleaf videos don't really work well on me. I pick up when it's something more interactive or hands on. Books are better. Concise tutorials are best. But the major point is, bandwidth is highly exorbitant in my country so I can't presently afford to watch those videos.

@Snapey methinks what it does is pretty clear: They're trying to create a User instance for this session but the User constructor only yields an instance when contents of the form matches what's in the database. How am I supposed to study what happens in the files when the controller methods are probably altered in microseconds?

All of this sounds like I'm a convoluted pedantic biased against Laravel. That's why it seems like a myth to me because none of you experienced all the horrors I have described.

On closer inspection, I observed this line

 'username' => strtolower(Input::get('username' ))

when the view clearly has an email input instead. In the oversight's defence, I carelessly copied the snippet just to see Laravel work at least. So I changed all occurrences of username in that method to email and the new error is TokenMismatchException.

I also think it's funny that after running make:auth and the subsequent disappearance of method loginPost, attempts to login threw no errors informing me that method was undefined. They probably have __get somewhere in these 1000 files sweeping that error under the rug and moving on while I bang my head in search of a solution.

TokenMismatchException means a new session has been created but the ID doesn't rhyme with what's in my page header (or something like that). I have an idea cuz I bore that cross at some point before coming here. The circular hole of torment smh.

2 years ago
Activity icon

Replied to How To Auth With Laravel 5.4

Sorry for the delay in responding guys; I momentarily lost access to my machine.

@jbowman99 I've already modified table users to contain column remember token. I can't find where I'm required to also have column ID. The actual problem is that I'm not in charge of that query. This query

"Column not found: 1054 Unknown column 'id' in 'where clause' (SQL: select * from users where id = nmeri17 limit 1".

Where do I get to change it so I can conveniently replace ID there with username instead?

@abusalameh I also tried your suggestion and it reverted to the dormancy I had when I first opened the thread. When the form is submitted, the page just reloads with the email address. No errors or anything.


so just so that we understand each other, you check the users login credentials and then create a user ??

huh? :confused: I said I already created a model schema and data. I just want to log in and see that laravel is a real thing. I'm not even in the development phase yet and this has been going on for several weeks. I can show you earlier threads I created if you want. The credentials I'm entering in the login form are the exact ones I seeded the table users with except the password which I first converted to its hash equivalent.

One thing I observed is that there is no method in the controller nor routes for handling post requests to the login or register. Which is probably why the page just reloads when the form is submitted. That's why I began messing around with the loginPost method and all those static methods in there. You insist everything works out of the box it isn't here. I've reinstalled laravel even (with all the losses I incurred in so doing)

Activity icon

Replied to How To Auth With Laravel 5.4

@abusalameh I'd already done that before so redoing kept asking if I wanno overwrite the views. This time though when it was done and I tried logging in, the error message says

Column not found: 1054 Unknown column 'id' in 'where clause' (SQL: select * from users where id = nmeri17 limit 1

How do I make it search with username instead of ID. The username that corresponds to the seeded email is nmeri17.

Activity icon

Replied to How To Auth With Laravel 5.4

@bipin you said I shouldn't modify anything in the controller, then you say in the next line I should override my controller. Do I need extra classes besides the HomeController default class?

Activity icon

Started a new conversation How To Auth With Laravel 5.4

I keep getting all sorts of funny errors just by trying to see an application can actually work in Laravel and that it's not a myth. First, I had to wrestle with all the suggestion on this issue. Painfully, the answer that helped me was the penultimate on such a long long thread of framework contributors living in denial. I've encountered dozens more, scoured tutorial sites, read this official doc on Laravel auth and stackoverflow questions with outdated answers to the cryptic errors I've been riddled with.

Some of the errors would have been avoidable if my auth table name was simply "users" and even now I've changed to "users", I'm still stuck.

I eventually logged in at some point by removing this line


from the HomeController constructor then manually setting up my own auth like I would have done in 30mins if I was developing from scratch. But it felt contrived. The tutorials say everything should work out of the box without touching any native PHP functions so I uncommented the line and continued writhing.

The present situation is that the login form just lies there even though I've manually seeded my database. From the web.php file (which I understand is neo routes.php), I have

Route::post('/login', '[email protected]');

Then in its controller, the latest snippet I've tried is this

public function loginPost() {
        if (Auth::attempt(Input::all())) {
        'username' => strtolower(Input::get('username')),
        'password' => Hash::make(Input::get('password')),

$user = User::where('username', '=', strtolower(Input::get('username')));

        else var_dump('expression2');

It's probably supposed to be email there instead of username but I did a replace all in the view, swapping email for username since the application's authentication ID should be their usernames and not their emails. When I hit enter now, the page just reloads with empty input fields. It's even tired of throwing errors at me. Is there a way out or is Laravel just not for me?