knubbe82

knubbe82

Web Developer at 42coders

Member Since 1 Year Ago

Belgrade

Experience Points
57,130
Total
Experience

2,870 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
516
Lessons
Completed
Best Reply Awards
5
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 12
57,130 XP
Oct
10
1 week ago
Activity icon

Replied to How To Call A Method Where FormRequest Is Required?

but error point me to the details method and the controller where I wrote that method. If I use $this->validate in method everything works fine, even auth()

Activity icon

Replied to How To Call A Method Where FormRequest Is Required?

I want to call details method that request FormRequest

Activity icon

Replied to How To Call A Method Where FormRequest Is Required?

public function __invoke()
    {
        $this->details(request());
    }

protected function details(ValidateCrewMemberAttributesRequest $request)
    {
        $crewMember = auth()->user()->owner;

        $crewMemberDetails = $request->except('spoken_languages');
        $crewMemberDetails = transformDates($crewMemberDetails, ['date_of_birth', 'document_expires']);

        $crewMember->update($crewMemberDetails);

        $crewMember->setSpokenLanguages($request->spoken_languages);
    }
Activity icon

Replied to How To Call A Method Where FormRequest Is Required?

Argument 1 passed to details() must be an instance of StoreCrewMember, instance of Request given

Activity icon

Replied to How To Call A Method Where FormRequest Is Required?

I don't understand, sorry

Activity icon

Started a new Conversation How To Call A Method Where FormRequest Is Required?

Is there a way to call store method that have dedicate form request from another method like $this->store(StorePost $request)

Oct
03
2 weeks ago
Activity icon

Started a new Conversation Global GetAttribute For All Dates Format

I want to create a trait that will have a getAttribute method that need to return specific date format but need to be used in all application and with all models. Does anyone have idea?

Oct
02
2 weeks ago
Activity icon

Replied to How Can I Get Casts Array Of Model In A Trait?

np, I already solve that but thanks

Activity icon

Started a new Conversation How Can I Get Casts Array Of Model In A Trait?

I create some trait to use in every model but that trait need to related to casts array of model. How can I get that casts array?

Sep
22
4 weeks ago
Activity icon

Replied to Is There Are Elegant Way To Store Auth()->id() On Every Created/updated Method?

One user can create a data but someone else can change and I need to know both

Activity icon

Started a new Conversation Is There Are Elegant Way To Store Auth()->id() On Every Created/updated Method?

I need to store auth()->id() in every model on every store and update method. I have two additional field in db 'created_by' and 'updated_by'. What would be the most elegant way to do this?

Sep
21
4 weeks ago
Activity icon

Started a new Conversation How To Validate That Field Must Be Greater Then Last Record Input

How to validate that kilometers field in form must be greater that last recorded data?

Sep
11
1 month ago
Activity icon

Replied to Allow Members To Vote On Topics For Next Laracast Video Series?

I think that new laravel 6 series is started

Aug
15
2 months ago
Activity icon

Started a new Conversation Use Js Class For Map Setup

I want to use class for setting up a map. This is my SmartMap class:

import * as L from "leaflet";

class SmartMap {
    constructor(element, longitude, latitude) {
        this.element = element;
        this.longitude = longitude;
        this.latitude = latitude;
        this.map = function () {
            return L.map(this.element).setView(this.longitude, this.latitude, 13)
        };
    }
}

export default SmartMap

methods of the class is not important. I also set this in app.js:

import SmartMap from './map/Map';
window.SmartMap = SmartMap;

In console, for the this.map method I get this:

map: ƒ ()
arguments: [Exception: TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them at Function.invokeGetter (<anonymous>:2:14)]
caller: [Exception: TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them at Function.invokeGetter (<anonymous>:2:14)]
length: 0
name: ""

Does anyone know why and solution for this?

Jul
23
2 months ago
Activity icon

Started a new Conversation Diff Doesn't Working

Can anyone tell me why diff doesn't working. This is what I have:

$users = collect($users)->flatten();
$seminarUsers = $users->unique('id')->diff($meeting->users);
dd($users->unique('id'), $meeting->users, $seminarUsers);

and this is what I have dumped:

Collection {#1414 ▼
  #items: array:9 [▼
    0 => User {#1551 ▶}
    1 => User {#1552 ▶}
    2 => User {#1553 ▶}
    3 => User {#1554 ▶}
    4 => User {#1555 ▶}
    5 => User {#1556 ▶}
    6 => User {#1557 ▶}
    7 => User {#1558 ▶}
    8 => User {#1559 ▶}
  ]
}

Collection {#1384 ▼
  #items: array:1 [▼
    0 => User {#1420 ▶}
  ]
}

Collection {#1389 ▼
  #items: array:9 [▼
    0 => User {#1551 ▶}
    1 => User {#1552 ▶}
    2 => User {#1553 ▶}
    3 => User {#1554 ▶}
    4 => User {#1555 ▶}
    5 => User {#1556 ▶}
    6 => User {#1557 ▶}
    7 => User {#1558 ▶}
    8 => User {#1559 ▶}
  ]
}
Jul
15
3 months ago
Activity icon

Replied to Managing Mass User Settings

{{ $stream->settings->notes }}
Activity icon

Replied to Validate Date After And Before

How this (date('H:i:s')) refers to last recorded time attribute?

Activity icon

Replied to Replacement Of $fillable In Laravel 5.5

You can use

protected $guarded = [];

or to use

$model->attribute = data;
$model->save();
Activity icon

Started a new Conversation Validate Date After And Before

I have a time field id database and in model I use protected $dates = ['time'];. Before saving a new record I must be sure that new record time is after last record time if that record exist (maybe it's first entry). How can I do that? I try this but it's not working

'time'              => 'required|after:'.$latestTime,
Jul
09
3 months ago
Activity icon

Replied to How To Add Row Number In Resource?

Dive number 1, Dive number 2, Dive number 3, Dive number 4...

Jul
08
3 months ago
Activity icon

Replied to Redirecting A Route

Can you share a controller method?

Activity icon

Replied to Redirecting A Route

return redirect()->route(route_name, ['id' => $restaurant->id]);

Activity icon

Started a new Conversation How To Add Row Number In Resource?

I have a resource class DiveResource where I have:

<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\JsonResource;
use Carbon\Carbon;

class DiveResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'id' => $this->id,
            'date_of_diving' => Carbon::parse($this->time)->format('d-m-Y'),
            'date' => Carbon::parse($this->time),
            'time_of_diving' => Carbon::parse($this->time)->format('H:i'),
            'location' => $this->location,
            'bottom_time' => $this->bottom_time,
            'max_depth' => $this->max_depth,
            'water_temp' => $this->water_temp,
            'day_night' => $this->day_night,
            'visibility' => $this->visibility,
            'dive_start' => $this->dive_start,
            'current' => $this->current,
            'tank_type' => $this->tank_type,
            'tank_capacity' => $this->tank_capacity,
            'bar_start' => $this->bar_start,
            'bar_start' => $this->bar_start,
            'bar_end' => $this->bar_end,
            'gas_mix' => $this->gas_mix,
            'belt_weights' => $this->belt_weights,
            'bcd_weights' => $this->bcd_weights,
            'description' => $this->description,
            'user' => $this->user->name,
            'created_at' => $this->created_at->diffForHumans()
        ];
    }
}

I want to add a row number as well but don't know how?

This is my index method in controller where I return this resource:

public function index()
    {
        return DiveResource::collection(auth()->user()->dives()->latest()->paginate(5));
    }

How to add row number in resource?

May
13
5 months ago
Activity icon

Replied to Validation Date

this is what I need: 'date_of_entry' => 'required|date_format:Y-m-d'

Activity icon

Replied to Validation Date

@DAVIDPETROV - date did't work for me

Activity icon

Started a new Conversation Validation Date

How to create validation rules for date format? Right now my app crashes when someone type 5 digits for year. I use default bootstrap date input type element

Apr
25
5 months ago
Activity icon

Replied to Problem With Confirmation Modal For Delete

@SNAPEY - there is nothing in network

Activity icon

Replied to Problem With Confirmation Modal For Delete

@TYKUS - I give a action attribute with $('#deleteUserForm').attr('action', '/users/'+id+'');

Activity icon

Replied to Problem With Confirmation Modal For Delete

@FTIERSCH - Yes I have that input hidden field because I use @method('DELETE')

Activity icon

Started a new Conversation Problem With Confirmation Modal For Delete

I use modal confirmation for deleting user. This is a button to call a modal:

<a class="btn btn-danger btn-sm" data-toggle="modal" onclick="deleteUser('{{ $user->id }}', '{{ $user->name }}')"><i class="fas fa-trash-alt"></i></a>

This is a modal:

<div class="modal fade" id="deleteUser" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog" role="document">
            <div class="modal-content">
                    <div class="modal-header">
                            <h5 class="modal-title"></h5>
                        </div>
                        <div class="modal-body">
                                <strong class="name text-muted"></strong>?
                        </div>
                        <div class="modal-footer">
                            <button type="button" class="btn btn-secondary" data-dismiss="modal">Izađi</button>
                                 <form method="POST" class="d-inline" id="deleteUserForm">
                                    @method('DELETE')
                                        @csrf
                                        <button type="submit" class="btn btn-danger delete"></button>
                                 </form>
                         </div>
                  </div>
         </div>
 </div>

This is js part

function deleteUser(id, name) {
            $('#deleteUser').modal('show');
            $('.modal-title').text(name);
            $('.name').text(name);
            $('.delete').text('Izbriši');
            $('#deleteUserForm').attr('action', '/users/'+id+'');
            $('.delete').on('click', function () {
                $('#deleteUserForm').submit();
            });
        }

I use resource controller for user and try to use destroy method but I get this error The POST method is not supported for this route. Supported methods: GET, HEAD, PUT, PATCH, DELETE.

Does anyone have a idea, please?