knubbe82

knubbe82

Member Since 1 Year Ago

Belgrade

Web Developer at 42coders

Experience Points 55,030
Experience Level 12

4,970 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 501
Lessons
Completed
Best Reply Awards 5
Best Reply
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

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

13 May
1 month ago

knubbe82 left a reply on Validation Date

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

knubbe82 left a reply on Validation Date

@DAVIDPETROV - date did't work for me

knubbe82 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

25 Apr
1 month ago

knubbe82 left a reply on Problem With Confirmation Modal For Delete

@SNAPEY - there is nothing in network

knubbe82 left a reply on Problem With Confirmation Modal For Delete

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

knubbe82 left a reply on Problem With Confirmation Modal For Delete

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

knubbe82 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?

05 Apr
2 months ago

knubbe82 left a reply on Can't Delete Directory With Storage Facade

@MEKADOO - try to provide real path, without storage_path helper

knubbe82 left a reply on Can't Delete Directory With Storage Facade

You don't need this public in url string in storage_path helpers

29 Mar
2 months ago

knubbe82 left a reply on Laravel Homestead With Apache Server

@BRAUNSON - yes, this is what I read also

28 Mar
2 months ago

knubbe82 started a new conversation Laravel Homestead With Apache Server

How to set Homestead for projects that requires Apache server? Right now in Homestead.yaml I only have Laravel projects

25 Mar
2 months ago

knubbe82 left a reply on Do You Use Vim?

Vim is a mother, father and directory of the school :) Little bit difficult to learn but you have a great course here on laracast that will help

19 Mar
3 months ago

knubbe82 started a new conversation Updating Lessons Status In Laracasts Bug?

Does anyone knows why series progress is not updating after completion lesson?

18 Mar
3 months ago

knubbe82 left a reply on Laravel Vue Router Not Working

You don't have mode: 'history' in router.js

14 Mar
3 months ago

knubbe82 left a reply on Career As A Software Developer

I have already changed my proficiency once in seven years and I do not see the reason why I would not do it again. I'm working as a developer in the agency for 2 years and before that I worked as a finance manager :)

knubbe82 left a reply on How To Check Does Range Times Overlap?

I solve something like this:

public function store(ScheduleStoreFormRequest $request)
    {
        $data = $request->all();

        $data['start'] = Carbon::createFromFormat('d.m.Y H:i', $request->start);
        $data['end'] = Carbon::createFromFormat('d.m.Y H:i', $request->end);

        if (Schedule::count() == 0) {
            return Schedule::create($data);
        }

        foreach (Schedule::all() as $schedule) {
            if (!($data['start'] >= $schedule->end || $schedule->start >= $data['end'])) {
                return ['error_message' => 'There is appointment in that period'];
            }
        }

        return Schedule::create($data);
    }

I also have validation that $data['end'] must be after $data['start']

13 Mar
3 months ago

knubbe82 started a new conversation How To Check Does Range Times Overlap?

I build some patient schedules and I have table where I store patient, start time and end time. I need some kind of validation to check does I already have some patients in that period when I inserting a new patient time.

11 Mar
3 months ago

knubbe82 left a reply on Error Saving Date Format (d/m/Y) To (Y-m-d)

Carbon\Carbon::parse('string')->format('Y/m/d')

15 Feb
4 months ago

knubbe82 started a new conversation Select And Open A Node That Is Just Created (jstree)

I am using jstree to organize groups. I have ALL GROUPS (root node) and children (groups). When I create a group (I am using form) I want to load jstree and automatically open and select newly created group.

This is my code (on load event):

$("#container").jstree().bind("loaded.jstree", function (e, data) {
            var groupId = `{{ $groupId }}`;
        $('#container').jstree(true)._open_to(groupId);

but I can open anything. Does anyone knows solutions?

12 Feb
4 months ago

knubbe82 left a reply on Add New Column To Existing Table

You must define column in Schema::table

knubbe82 left a reply on What Are The Most Common Libraries, Admin Panels Etc That You Use?

Bootstrap is already include in laravel

08 Feb
4 months ago

knubbe82 left a reply on How To Get All Children Recursively?

@STAUDENMEIR - I get relationship in relationship but I need them in same level

knubbe82 left a reply on How To Get All Children Recursively?

I get relationship in relationship but I need them in same level

knubbe82 left a reply on How To Get All Children Recursively?

@STAUDENMEIR - Still the same. I get on first child

knubbe82 started a new conversation How To Get All Children Recursively?

I am trying to get all children of model recursively but can't get children of children. This is what I have:

public function children()
    {
        return $this->hasMany('App\Group', 'parent_id', 'id');
    }

I also try this:

public function childrenRecursive()
    {
        return $this->children()->with('childrenRecursive');
    }

In both cases when I use $group->children or $group->childrenRecursive() I get only children but not children of children.

01 Feb
4 months ago

knubbe82 left a reply on How To Set An Array Globally Available In Laravel?

You can set your arrays in boot method of AppServiceProvider.php something like this:

\Illuminate\Support\Facades\View::composer('*', function ($view) {
$eu = ['germany', 'france'];
            $view->with('some_name', $eu');
        });
31 Jan
4 months ago

knubbe82 left a reply on Call Method From Vue

@PRESMELITO - How to style in component after setup main color in window.App.main_color?

knubbe82 left a reply on I Can Log Email But Can't Send It

@BOBBYBOUWMANN - I find a solution. Instead of sending mail I create a notification and in User.php now I have this:

public function sendPasswordResetNotification($token)
    {
        $this->notify(new MailResetPasswordNotification($token, $this));
    }

and I use email channel in notification

30 Jan
4 months ago

knubbe82 left a reply on I Can Log Email But Can't Send It

@BOBBYBOUWMANN - Yes because all other mails works fine

knubbe82 left a reply on Select Tag With Multiple

<select name="cars[]" multiple>

knubbe82 started a new conversation I Can Log Email But Can't Send It

How is possible that I can log email but can't send it?

User.php

public function sendPasswordResetNotification($token)
    {
        Mail::send(new PasswordResetMail($this, $token));
    }

PasswordResetMail.php

class PasswordResetMail extends Mailable implements ShouldQueue
{
    use Queueable, SerializesModels;

    public $user;
    public $token;

    /**
     * Create a new message instance.
     *
     * @param $user
     * @param $token
     */
    public function __construct($user, $token)
    {
        $this->user = $user;
        $this->token = $token;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->markdown('emails.reset_password');
    }
}

knubbe82 started a new conversation Call Method From Vue

In vue file I have some styling and I need something like this:

p {
    color: {{ .MasterData::first()->main_color }}
}

How can I do it?

29 Jan
4 months ago

knubbe82 left a reply on Online School For Web Development

Udemy is a great choice

25 Jan
4 months ago

knubbe82 left a reply on Remove Pivot Table Entries When Deleting Records

$game->players()->detach();

knubbe82 left a reply on Query Problem -> Wrong Data

This is approach that works:

$seminars = Seminar::whereHas('users',function ($query) use ($user) {
                                            $query->where('users.id', $user->id);
                                          })->whereHas('meetings.users', function ($query) use ($user) {
                                            $query->where('user_id', $user->id);
                                            })->with([
                                            'users' => function ($query) use ($user) {
                                                $query->where('users.id', $user->id);
                                            },
                                            'meetings.users' => function ($query) use ($user) {
                                                $query->where('user_id', $user->id);
                                            }])->get();

knubbe82 left a reply on Query Problem -> Wrong Data

@NIKOS - yes but meetings.users must also be like $query->where('meetings.users.id', $user->id) and that's not work

24 Jan
4 months ago

knubbe82 left a reply on Query Problem -> Wrong Data

@NIKOS - I must have meetings and also meetings.users (meetings.users is pivot between users and meetings)

knubbe82 left a reply on Query Problem -> Wrong Data

@CIPSAS - This is not what I except. It's the same like my query but getting wrong date also

knubbe82 started a new conversation Query Problem -> Wrong Data

I know a User but I need to get Seminars with that User and must use something like this: Seminar::with...

This is what I have:

$user = User::findOrFail($request->user_id);
            $seminars = Seminar::with(['users', 'meetings.users'])->whereHas('users', function ($query) use ($user) {
                $query->where('users.id', $user->id);
            })->get();

users and meetings.users are pivot

Problem that I have is 'I receive all users that participate in seminar that specific users also belongs'

How can I solve this?

knubbe82 left a reply on How To Inline Two Components Button In Mail Markdown

After searching a while best possible solutions is to not a use component. Instead of that two inline buttons could save your day ;)

23 Jan
4 months ago

knubbe82 left a reply on Invalid Argument Supplied For Foreach()

Need to know what is watchers?

knubbe82 left a reply on Laravel Console Commands Option

you have all options describe in ControllerMakeCommand in getOptions() and for example -m is for creating a Model also, -r is for resource...

22 Jan
4 months ago

knubbe82 left a reply on Laravel Evangelist Badge

@SNAPEY - I did it last month :)

knubbe82 started a new conversation How To Inline Two Components Button In Mail Markdown

How to inline two components button in laravel mail markdown?

@component('mail::message')

@component('mail::panel', ['url' => ''])
    <h1 class="text-center">{{ __('lms.Request') }} from {{ $user->username }}</h1>
@endcomponent
<p class="lead">{{ $tutor->getSalutation() }}</p>
<p class="lead">{{ $user->getFullNameAttribute() }} requested to participate in {{ $reference->name }}</p>
<p class="lead">Accept?</p>

@component('mail::button', ['url' => route('approved', ['id' => $referenceRequest->id])])
    Yes
@endcomponent
@component('mail::button', ['url' => route('frontend.messages')])
    No
@endcomponent

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

knubbe82 started a new conversation Laravel Evangelist Badge

How to earn laravel evangelist badge :) I share link to my twitter profile and send by email to laracast

17 Jan
5 months ago

knubbe82 left a reply on Validation

what is the question?

knubbe82 left a reply on Checking Two Different Models And Returning The Results

You need relation between auction and bids (one to many) and then:

$auctions = Auction::whereHas(' name of relation with bids ', function ($query) {                                                    
                                  $query->whereStatus('1');
                      }])->get();

15 Jan
5 months ago

knubbe82 left a reply on How To Add Laravel Project To Github?

when you create a repo on github you will get instruction how to sync