sktklaus

sktklaus

Member Since 1 Year Ago

Experience Points
4,460
Total
Experience

540 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
37
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
4,460 XP
Sep
05
1 month ago
Activity icon

Replied to Can't Get Ignition To Open File In Phpstorm

if Windows, go to Environment variables and set the path to phpstorm.

Aug
30
1 month ago
Activity icon

Started a new conversation Working With Translations

Hi everyone,

what would be the best way to go through a multi-language Vue SPA.

Laravel can handle 'locale' just fine, but passing all the translations to Vue in a simple way to use, like t(key).

and what about the database structure, I thought about having a table for translations and a polymorphic Translatable. So every data I need to store would have a relationship saying its language.

Thanks, Klaus

Aug
23
1 month ago
Activity icon

Started a new conversation Eloquent Avg On Nested Items

 $status = Company::with('members',  'members.tasks', 'members.tasks.rating')->findOrFail(1);

my ratings has a column score, how can I add the avg score to every members in this query?

Jun
25
3 months ago
Activity icon

Replied to Vue Axios Redirect With Flash Message

Is it an SPA?

Are you using Vuex?

call the flash('message') then this.$router.push();

May
14
5 months ago
Activity icon

Replied to Print List Of Logged In Users

You might consider creating a online_presence_table that holds

  • timestamps
  • boolean online
  • foreign userId

and you can fetch online users, user details and time they've been active.

Mar
28
6 months ago
Activity icon

Started a new conversation Response Data Relations

I have my users and TeamLeads Users:: TeamLeads::

If I get the users, the response starts like this

{
    "success":true,"message":"Success",
    "data":{
        "current_page":2,"data":
        [
            {"country":"IN","title":null,"type":"specialist"}
        ]
    }
}

How can I add an attribute to every user in the response, if the id exists in another table?

$leaderIds = TeamLeadUserMap::get()->pluck('userId');

and return

{
    "success":true,"message":"Success",
    "data":{
        "current_page":2,"data":
        [
            {TeamLead:true, "country":"IN","title":null,"type":"specialist"}
        ]
    }
}
Feb
16
8 months ago
Activity icon

Replied to Nested Object In Response API

@BRAUNSON - Perfect!

Thank you!

Activity icon

Started a new conversation Nested Object In Response API

Trainer::find(1) // returns my trainer

Trainer::find(1)->fighters()->get // returns all the fighters related to this trainer

How can merge the results to get something like this?

data {
    trainer_name: "name",
    id: 1,
    fighters: [
    {
        "id": 1,
        "nick": "hazel.hermiston",
            "battles": "46"
    },
    {
        "id": 2,
        "nick": "cormier.cathryn",
            "battles": "46"
    }]
}
Feb
14
8 months ago
Activity icon

Started a new conversation Laravel Local Domain

How does Jeffrey use a domain to access his Laravel projects? I'm using Windows and Laravel5.7

Aug
14
1 year ago
Activity icon

Started a new conversation Laravel Algolia Search

How can I mix this algolia template with laravel route() or asset()?

e.g. My href needs to link to a route with the ID coming from algolia

<a class="white-text" href="{{route('cases.show',result.id)}}">

                <ais-results>
                    <template scope="{ result }">
                        @{window.location.origin}
                        <a class="white-text" href="#">
                            <div class="light-blue darken-4 relative">
                                <div class="parallax-effect valign-wrapper justify-center opacity"></div>
                                
                                <div class="caption center center-align">
                                    <h5>@{{result.client_name}}</h5>
                                    <p>@{{result.created_at}}</p>
                                    <h1 cl style="margin:0">@{{result.project_name}}</h1>
                                    <p class="center case-mobile-padding" style="align-self: center;">@{{result.what_we_did}}</p>
                                </div>
                            </div>
                            <br>
                        </a>
                    </template>
                </ais-results>
Aug
02
1 year ago
Jul
10
1 year ago
Activity icon

Replied to How To Setup Custom If Statement

if I don't set a parameter @admin('something') it returns an error.

@role('owner')

Owner

@endrole

@role('member')

Member

@endrole Can also pass an array of multiple roles

@role(['member', 'owner'])

Member or Owner

@endrole

I'm very new to php / laravel, I found this, but don't know how to adapt

Blade::directive('role', function($roles) {

        $user = auth()->user();

        $userRole = $user->roleOn($user->currentTeam);

        return "<?php if((is_array(with{$roles})) ? in_array('$userRole', with{$roles}) : with{$roles} == '$userRole') : ?>";
});
Activity icon

Started a new conversation How To Setup Custom If Statement

This returns a bool saying if I'm admin or not

  • Auth::guard('admin')->check()

This returns my role

  • Auth::guard('admin')->user()->role

Following this link https://laravel.com/docs/5.6/blade#custom-if-statements

How can I create something like @admin() To return if I'm admin and

@admin('manager', 'owner', 'administrator') to make a conditional if role == manager or owner or administrator ?

Apr
23
1 year ago
Activity icon

Replied to Laravel Mailables

It returns 'Undefined Variable '

Activity icon

Started a new conversation Laravel Mailables

If I use this

        Mail::send('emails.jobapplication', $data, function($message) use ($data){
            $message->from('[email protected]');
            $message->to('[email protected]');
            $message->subject($data['name']);
        });

It works but I can't use the mail component

@component('mail::message')
# Introduction

Video Notification Email.
{{$username}}

@component('mail::button', ['url' => ''])
Button Text
@endcomponent

Thanks,<br>
{{ config('app.name') }}
@endcomponent

If I sent with ``` Mail::to('[email protected]')->send(new VideoNotification());

It uses the component, but I can't pass my data, 
How do I fix it?
Apr
19
1 year ago
Activity icon

Started a new conversation Laravel Html Variables With Vue

Hi,

<b-input type="textarea" placeholder="Compose your masterpiece..." rows="5" name="bio" v-model="job_responsabilities"></b-input>

@{{job_responsabilities}}

In laravel I can use {!! $variable !!} when retrieving data from the database and display as html, not just string.

But is there a way to do the same with v-model?

Apr
12
1 year ago
Activity icon

Replied to Signed-URLs

A bug to update from 5.5 to 5.6, not to use the feature. https://stackoverflow.com/questions/48594851/upgrading-laravel-5-5-to-5-6-error

Activity icon

Replied to Laravel Middleware: Role + Signed URL

This is a new feature, you have to update laravel to 5.6.*

https://laravel.com/docs/5.6/urls#signed-urls

Activity icon

Started a new conversation Laravel Middleware: Role + Signed URL

In my Routes I have videos/{id} I want to use a Signed URL, which works fine, but I also want to access the page if logged as admin, but I don't know how to use both together. as admin, when I access the page

middleware('signed','role:superadministrator|administrator')

it returns invalid signature

Route::get('/videos/{id}', '[email protected]', function (Request $request, $id, $user, $company) {
  if (! $request->hasValidSignature()) {
    abort(401);
  }
})->name('video')->middleware('signed','role:superadministrator|administrator');
Activity icon

Replied to Signed-URLs

There's a bug when updating from Laravel 5.5.* to 5.6.* Solved it...

Apr
11
1 year ago
Activity icon

Replied to Signed-URLs

I always get Method signedRoute does not exist. I updated my laravel, so I don't know, do I have to create this method?

Activity icon

Started a new conversation Signed-URLs

How do I use this new feature? Signed-URLs / Signed Routes.

I'm not finding anything but this link - https://laravel.com/docs/5.6/urls#signed-urls and I don't understand how to use it.

In which file I use this?

use Illuminate\Support\Facades\URL;

return URL::signedRoute('unsubscribe', ['user' => 1]); Everything I tried, returns signedRoute is not a method.

There's nothing on Laracast, Youtube, StackOverflow,

Thank you.