Moenchfracht

Moenchfracht

Member Since 1 Year Ago

Experience Points
2,880
Total
Experience

2,120 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
13
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • 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.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    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
2,880 XP
Sep
13
3 months ago
Activity icon

Replied to Session Push Data Array

I found a workaround using:

foreach (request()->except('_token') as $key => $value) {
            \Session::put('companydetails.'.$key, $value);
        }

But there must be an easier way - or??

Activity icon

Started a new Conversation Session Push Data Array

Hello, I have an array 'companydetails' with some values in it stored in my session. I want to add all request inputs using: \Session::push('companydetails', request()->all()); but this adds a new array to the existing one. Here's the output:

  "companydetails" => array:7 [▼
    "name" => "test 123"
    "address" => "addr 123"
    "zip" => "1010"
    "city" => "v"
    "phone" => "12341234"
    "title" => null
    0 => array:1 [▼
      "submit_county" => "1"
    ]
  ]

I want to add the "submit_county" value to the companydetails without the [0] Thanks for help!

Aug
23
3 months ago
Activity icon

Replied to New Registered Class

Thanks, I extended the Class and I also implemented Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContractin my User class. Now it's working! :-) Thank you!

Activity icon

Replied to New Registered Class

Well thanks for that. Now I am one step further with the next error

Argument 1 passed to Illuminate\Auth\Listeners\SendEmailVerificationNotification::handle() must be an instance of Illuminate\Auth\Events\Registered, instance of App\Events\RegisteredCompany given

Activity icon

Replied to New Registered Class

Here:

<?php

namespace Illuminate\Auth\Events;

use Illuminate\Queue\SerializesModels;

class RegisteredCompany
{
    use SerializesModels;


    /**
     * The authenticated user.
     *
     * @var \Illuminate\Contracts\Auth\Authenticatable
     */
    public $user;

    /**
     * Create a new event instance.
     *
     * @param  \Illuminate\Contracts\Auth\Authenticatable  $user
     * @return void
     */
    public function __construct($user)
    {
        $this->user = $user;
    }
}

Activity icon

Replied to New Registered Class

I also tried this before, but I still get this error:

Symfony \ Component \ Debug \ Exception \ FatalThrowableError (E_ERROR)
Class 'App\Events\RegisteredCompany' not found
Activity icon

Started a new Conversation New Registered Class

Hi. I tried to make my own Registered Class because I want to send two different Verification-Emails (one for companies and one for customers). I made a new event using php artisan make:event RegisteredCompany. Then I copied the Registered-Classfrom vendor\laravel\framework\src\Illuminate\Auth\Eventsto my RegisteredCompany-Class. Then I changed the EventServiceProvider to

protected $listen = [
            App\Events\RegisteredCompany::class => [
                SendEmailVerificationNotification::class,
            ],
        ];

In my RegisterControllerI added this method:

    public function registerCompany(Request $request)
    {
        $this->validator($request->all())->validate();
        $createData = [
            "name" => $request->name,
            "email" => $request->email,
            "password" => $request->password,
            "is_company" => true
        ];
        event(new App\Events\RegisteredCompany($user = $this->create($createData)));

        $this->guard()->login($user);

        return $this->registered($request, $user)
            ?: redirect($this->redirectPath());
    }

And now Laravel doesn't find the RegisteredCompany Event. :-(

Can anyone tell me what is wrong here. Thanks!

Aug
06
4 months ago
Activity icon

Replied to Two Auth Models

Thanks @snapey - I will think about it. :) But do you know how to implement the email verification with my system?

Activity icon

Replied to Two Auth Models

Sorry for bringing back (reuse) this thread. I solved this with 2 different guards. I want to use MustVerifyEmailso my classes for customers and companies look like this:

[...] use Illuminate\Contracts\Auth\MustVerifyEmail; [...] class Customer extends Authenticatable implements MustVerifyEmail [...] Schema for both models include the email_verified_atcolumn. The new user ist in the right table, and login works, but without the verification. Is there something I forgot?? Thanks (again)!

Jul
19
4 months ago
Activity icon

Replied to Two Auth Models

Thanks @jlrdw . So the best way is using different guards and have one user model with boolean is_company? And then have one model for the user details and one for company details?

Activity icon

Replied to Two Auth Models

Thanks, but I want to have complete different tables/models for users and companies.

Activity icon

Started a new Conversation Two Auth Models

Hello, I need some help because I don't know where to start with this. In my project I need a registration (and login) for customers and one for companies. How do I start with the authentication? Should I use the standard auth mechanism or do I have to write everything manually?

Thanks!