kieferjs

Member Since 2 Months Ago

Experience Points
5,600
Total
Experience

4,400 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
53
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.

  • Community Pillar

    Earned once your experience points ranks in the top 10 of all Laracasts users.

Level 2
5,600 XP
Mar
02
1 month ago
Activity icon

Replied to Passing ID To Detail Page

I resorted to moving the detail page into a traditional laravel blade and controller and will bring in very specific livewire components for specific needs.

Activity icon

Replied to Passing ID To Detail Page

and when I turn that line off and just reference the livewire view in the blade file, I'm back to this error:

"unable to resolve dependency [Parameter #0 [ $id ]] in class App\Http\Livewire\AgentDetail"

Activity icon

Replied to Passing ID To Detail Page

This is where it fails.

@section('content') @livewire('agent-detail' ,['id' => $id]) @endsection

Activity icon

Replied to Passing ID To Detail Page

Hi. I plugged that into the function. I still get a "Undefined variable $id" error on the detail blade file.

Activity icon

Started a new Conversation Passing ID To Detail Page

Hi! I'm new to Livewire and I've got 2 pages using livewire and livewire components. I have the list page showing the rows just fine and when I click the button in the blade, the row ID passes properly into the route. However, I'm unable to load the detail page filtered on that ID. Spinning my wheels and would greatly appreciate some help.

My list page blade passes this:

<a wire:click="showAgent({{ $agent->id }})" href='{{ route('agent-detail', $agent->id) }}'>.......

I have this function in my list page component:

public function showAgent($id)
{
    $agent = Agent::find($id);
    $this->agent = $agent;
    $this->emit('agentUri',$agent->id);
}

For my detail page livewire, I use the following:

Blade page: @section('content') @livewire('agent-detail' ,['id' => $id]) @endsection

Component page:

class AgentDetail extends Component { public $agentId; // public Agent;

protected $listeners = ['agentUri'];

public function mount($id)
{
    $this->agent = Agent::find($id);
}

public function agentUri($agentId)
{
    // here u have the id in your other component.
}

public function render()
{

    return view('livewire.agent-detail');
}

}

Feb
11
2 months ago
Activity icon

Replied to Multi-Tenant - Admin Registration - Assign Tenant ID

I found a solution. Here is what I used inside the Create statement after it validates:

    $tenant_key = $input['registration_code'];
    $tenant = Tenant::where('registration_code',$tenant_key)->get();
    $data= $tenant->pluck('id');
    $id =str_replace (array('[', ']'), '' , $data);

    return Admin::create([
        'first_name' => $input['first_name'],
        'last_name' => $input['last_name'],
        'email' => $input['email'],
        'registration_code' => $input['registration_code'],
        'tenant_id' => $id,
        'password' => Hash::make($input['password']),

    ]);
Activity icon

Started a new Conversation Multi-Tenant - Admin Registration - Assign Tenant ID

I have set up a multi-tenant solution using the supported methods in the training videos here :). I've run into one issue:

My goal is to have tenant administrators receive a registration code which is assigned on the tenant table. If the administrator enters a matching registration code in the register form, that admin will get assigned the ID on the tenant table record that contains that matching registration code.

I was able to successfully validate that the entered code on the registration form exists and stops the registration if the code is invalid. However, I'm stuck with updating the admin table 'tenant_id' column with that ID value during the registration process for the new admin user. Any suggestions on how I can accomplish it?

Fyi-- I've tailored the registration process to be specific to Admins (not Users) for the web service. Users will register in a different method through mobile devices and API.

Here is what I have in the CreateNewUser.php file (Laravel Fortify).

public function create(array $input)
{
    Validator::make($input, [
        'first_name' => ['required', 'string', 'max:255'],
        'last_name' => ['required', 'string', 'max:255'],
        'email' => ['required', 'string', 'email', 'max:255', 'unique:admins'],
        'registration_code' => ['exists:Tenants,registration_code'],
        'password' => $this->passwordRules(),
        'terms' => Jetstream::hasTermsAndPrivacyPolicyFeature() ? ['required', 'accepted'] : '',
    ])->validate();

    return Admin::create([
        'first_name' => $input['first_name'],
        'last_name' => $input['last_name'],
        'email' => $input['email'],

// 'tenant_id' => Tenant::where('registration_code',$input['registration_code'])->pluck('id')->get(); 'password' => Hash::make($input['password']), ]); }

Below is the code to migrate the tenant_id column into the admin table. Note that everything works fine in my tenant solution once the tenant_id is populated for the registered user. I'm hoping that population can be accomplished through the registration process instead of a super admin assigning it manually.

class AddTenantidColumnToAdminsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('admins', function (Blueprint $table) { $table->unsignedBigInteger('tenant_id')->index() ->after('id') ->nullable(); }); }

/**
 * Reverse the migrations.
 *
 * @return void
 */
public function down()
{
    Schema::table('admins', function (Blueprint $table) {
        $table->dropColumn('tenant_id');
    });
}

}