Nakov

Nakov

at SOLID Solutions

Member Since 4 Years Ago

Skopje

Experience Points
434,480
Total
Experience

0 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
1582
Lessons
Completed
Best Reply Awards
461
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 50
434,480 XP
Nov
17
7 hours ago
Activity icon

Replied to Jeffrey's New Theme For PHPStorm

You could check the comments under the video as there is always someone mentioning the new theme, or just ask there and there will be someone to respond.

Activity icon

Replied to Adminlte Checkbox Custom-control From Database Not Work Fine

@manof360 you should check if there is a javascript code that makes the problem.. have you tried using plain checkboxes without any styling if that works.. for example:

@foreach ($roles as $role) 

<label>{{ $role->name }}</label>
<input type="checkbox" name="roles[]" value="{{ $role->id }}" />
@endforeach
Activity icon

Replied to GET Axios Request Blocked By CORS (only Failing For This Specific Request, Others Are Working)

@bigweld86 can you please share your api.php file content? What's different between the routes?

Do you have your APP_URL=http://127.0.0.1:8000 within your .env file?

Nov
16
1 day ago
Activity icon

Replied to Vue Components Are Not Working

@haz_ Thanks for the suggestions in what I should do in the future :) as for the presence I've read the whole post and all of the replies.

But saying something worked yesterday and suddenly does not work, how does it sounds to you? The computer did magic behind your back and now it decided not to work? Or it somehow happened that you ran npm install -g npm which upgrades npm or ran a npm update in your project and you are running different versions then yesterday?

So the issue is explained, but without any direction. So using Git should solve your problem for the future. And I will take care of my future too :)

And as a last tip, try installing a completely new project and check if Vue will run there, then compare :)

Activity icon

Replied to Storage Session Error

@davy_yg you should not even copy those files at all. Those are cached files, and it works on the other computer because the User of that computer is the owner of those files, and not the user on the new computer..

Take a look at using Git as a version control system, create a project on GitHub or BitBucket, and share the code that way between machines/server.

Activity icon

Replied to Str Limit Using QuillJS

@theunforgiven another option would be to limit the content using number of words, as the image will be one word, so it should display correctly, take a look here:

https://laravel.com/docs/master/helpers#method-str-words

Activity icon

Replied to Vue Components Are Not Working

@haz_ saying yesterday it worked and today it doesn't, won't help :)

Don't you use Git or any version control so you can compare the changes between yesterday and today? :)

Activity icon

Replied to [Laravel]Authentification System Doesn't Works Correctly.

@shockwave619 not after the return, it should be before that:

protected function create(array $data)
{
    dd($data);
   
    return User::create([
        'name' => $data['name'],
        'email' => $data['email'],
        'password' => Hash::make($data['password']),
    ]);     
}
Activity icon

Awarded Best Reply on Display All Users With Lower Role_id?

@sjking85 this is my try :)

I would add a scope method within the user model:

public function scopeListUsers($query)
{
    if($this->role_id === 3) 
    {
        return $query->where('role_id', 3);
    } 
    elseif ($this->role_id === 2)
    {
        return $query->whereIn('role_id', [2, 3]);
    }

    return $query; // no need for super admin
}   

Then to use it:

auth()->user()->listUsers()->get();

Something like this, give it a try :) or someone else will suggest a better approach :)

Also instead of magic numbers, create constants:

public const EDITOR = 3;

and use it as User::EDITOR

or something like that.

Activity icon

Replied to [Laravel]Authentification System Doesn't Works Correctly.

@shockwave619 and in your web.php you've got Auth::routes()

Can you add a breakpoint within the RegistersController - create method:

dd($data);

Does it dumps the data?

Do you have users table in your database?

Activity icon

Replied to [Laravel]Authentification System Doesn't Works Correctly.

@shockwave619 can you share your registration form? Are you checking for any errors in the session, in case the validation does not passes?

Activity icon

Replied to [Laravel]Authentification System Doesn't Works Correctly.

@shockwave619 do you have the db setup correctly, your .env file is okay? You've ran php artisan migrate?

Activity icon

Awarded Best Reply on Vuejs TimeLine

Here is a short list:

https://vuejsexamples.com/tag/timeline/

The best one is the one looks the best for your use-case :)

What I will consider

  • If the code is easy to read for me personally, so I can easily modify it
  • If it is hosted on GitHub, check how many issues are open, how many stars it has
Activity icon

Replied to Vuejs TimeLine

Here is a short list:

https://vuejsexamples.com/tag/timeline/

The best one is the one looks the best for your use-case :)

What I will consider

  • If the code is easy to read for me personally, so I can easily modify it
  • If it is hosted on GitHub, check how many issues are open, how many stars it has
Activity icon

Awarded Best Reply on How To Control In Redirect Function Depends On The Clicked Button?

@ebrahemsamer have you tried just returning back? Like this:

 return back()->withStatus(__('User successfully deleted.'));
Activity icon

Replied to How To Control In Redirect Function Depends On The Clicked Button?

@ebrahemsamer have you tried just returning back? Like this:

 return back()->withStatus(__('User successfully deleted.'));
Activity icon

Replied to The GET Method Is Not Supported For This Route. Supported Methods: POST.

@chenchen11 when you say it does not work is not enough, as I don't have your codebase to run. Have you checked the Developer console in your browser in case there is an error that you can share? Does you hit the endpoint at all?

Activity icon

Replied to Display All Users With Lower Role_id?

@sjking85 this is my try :)

I would add a scope method within the user model:

public function scopeListUsers($query)
{
    if($this->role_id === 3) 
    {
        return $query->where('role_id', 3);
    } 
    elseif ($this->role_id === 2)
    {
        return $query->whereIn('role_id', [2, 3]);
    }

    return $query; // no need for super admin
}   

Then to use it:

auth()->user()->listUsers()->get();

Something like this, give it a try :) or someone else will suggest a better approach :)

Also instead of magic numbers, create constants:

public const EDITOR = 3;

and use it as User::EDITOR

or something like that.

Activity icon

Replied to The GET Method Is Not Supported For This Route. Supported Methods: POST.

@chenchen11 are you still getting the same error? or it posts the data?

Because now you have bad usage in your controller you are posting Name and Pnumber but in the controller you are getting input_Name...

change in your controller to this:

$data->Name = $request->Name;

$data->Pnumber = $request->Pnumber;

Activity icon

Awarded Best Reply on Laravel Vue "invalid Expression: Invalid Or Unexpected Token In"

@masumluf I reproduced the same error. Fixed it this way:

:email="{{ json_encode(auth()->user()->email) }}"
Activity icon

Replied to The GET Method Is Not Supported For This Route. Supported Methods: POST.

@chenchen11 but you are not posting the data to the endpoint:

axios.post('/add', {
    name: this.input_name,
    phone: this.input_Pnumber
})
.then(response => {
    this.Records();
    this.input_name = '';
    this.input_Pnumber = '';

    alert(response.data); 
})
.catch(error => {
    console.log(error);
});
Activity icon

Replied to Laravel Vue "invalid Expression: Invalid Or Unexpected Token In"

@masumluf happy to help :) consider marking the answer as "Best Answer" it might help others :)

Activity icon

Replied to Laravel Vue "invalid Expression: Invalid Or Unexpected Token In"

@masumluf I reproduced the same error. Fixed it this way:

:email="{{ json_encode(auth()->user()->email) }}"
Activity icon

Replied to Setting Up New Project

@jmyersnc happy to help :) consider marking the answer as "Best Answer" the links might help others too :)

Activity icon

Replied to One Custom Request Class For Both Create And Update Action

@untymage I don't see any problem with it, as you are not validating the data so it will be ignored as it does not exists. If you want to get rid of it, you can use :

$this->request->remove('data')

After this line:

$this->request->add($this->request->get('data'));

Glad that it works anyway :)

Activity icon

Awarded Best Reply on One Custom Request Class For Both Create And Update Action

You can modify your request input before it is being validated in the custom form request by overriding the getValidatorInstance method.. so try this please:

protected function getValidatorInstance()
{
    if($this->isMethod('patch')) // here use the method type for your update 
    {
        $this->request->add($this->request->get('data'));
    }

    return parent::getValidatorInstance();
}

Keep in mind that above $this->request->get('data') should return an array of the fields for validation.

Let me know if it works :)

Activity icon

Awarded Best Reply on @import Directive Only Works With Relative Path When Importing Css File In App.scss

@gfvante I believe that when you do this: "/resources/css/mystylesheet.css" this is not an absolute path, but it expects the file to be placed in the same folder with the file that you are importing in an additional resources/css directories.

An absolute path should be full path from your system, for example for me on a Mac would be:

/Users/nakov/projects/my-project/resources/css

Have you tried this?

Activity icon

Replied to @import Directive Only Works With Relative Path When Importing Css File In App.scss

@gfvante I believe that when you do this: "/resources/css/mystylesheet.css" this is not an absolute path, but it expects the file to be placed in the same folder with the file that you are importing in an additional resources/css directories.

An absolute path should be full path from your system, for example for me on a Mac would be:

/Users/nakov/projects/my-project/resources/css

Have you tried this?

Nov
15
2 days ago
Activity icon

Replied to Why When I Run An Artisan Command My Scheduler Run Too ?

@snapey Yeah, running it on 6.5.0 project it does not stop. I ran it on a 5.8.17 and putting a simple dd() within the schedule method stops any command from executing.

So the question is @ejeanneau which version are you using? As the problem seems to be fixed in newer versions.

Activity icon

Replied to Ajax Method Not Working For Select State Field

@neeraj1005 any error that you can share from your browser?

I believe also this:

url:'{!!URL::to('contact')!!}',

should be

url:"{!!URL::to('contact')!!}",

using different quotes just in case it breaks.

Activity icon

Replied to One Custom Request Class For Both Create And Update Action

You can modify your request input before it is being validated in the custom form request by overriding the getValidatorInstance method.. so try this please:

protected function getValidatorInstance()
{
    if($this->isMethod('patch')) // here use the method type for your update 
    {
        $this->request->add($this->request->get('data'));
    }

    return parent::getValidatorInstance();
}

Keep in mind that above $this->request->get('data') should return an array of the fields for validation.

Let me know if it works :)

Activity icon

Awarded Best Reply on How To Use Label Name Instead Of Input Name In Validation

@dicanio you can provide your custom messages as a third parameter:

$this->validate($request, [
          'name'=>'required',
          'surname'=>'required',
          'address'=>'required',
          'phone'=>'required'
        ], 
[
    'name.required' => 'Message in your language'
]);

I will personally create a form request and use the messages method to return personalized messages instead of putting everything in the controller.

Activity icon

Replied to How To Use Label Name Instead Of Input Name In Validation

@dicanio you can provide your custom messages as a third parameter:

$this->validate($request, [
          'name'=>'required',
          'surname'=>'required',
          'address'=>'required',
          'phone'=>'required'
        ], 
[
    'name.required' => 'Message in your language'
]);

I will personally create a form request and use the messages method to return personalized messages instead of putting everything in the controller.

Activity icon

Replied to Missing Props 'deadline'

@shem and why I don't see it in the code that you have shared? Have you compiled the assets after adding it, using npm run dev ?

Activity icon

Replied to Missing Props 'deadline'

@shem damn, a whole bible here :)

No one can read this, you should wrap the code within ``` from each side for better styling..

Are you missing:

props: ['deadline'],

in your component?

Activity icon

Replied to Missing Props 'deadline'

@shem and what is your component code?

Activity icon

Replied to Pagination: How To Get Total Number Of Pages?

@jlrdw good point. Didn't noticed the method myself :) Thanks.

Activity icon

Replied to How To Make Default Attribute Dynamic?

@gwleuverink Accessor is to get a value, Mutator is to set a value :) And my answer above already does that, or you are thinking of something else?

Activity icon

Replied to How To Make Default Attribute Dynamic?

@chron why haven't you done that on the Database level?

$table->string('voucher')->default('freevoucher');

Otherwise you can override it with a mutator in the model maybe:

public function setVoucherAttribute($value)
{
    $this->attributes['voucher'] = $value ?? 'freevoucher';
}
Activity icon

Replied to Why When I Run An Artisan Command My Scheduler Run Too ?

@ejeanneau I know, but even if you run it without any command it will still invoke the schedule method :)

I tried dd('test') within the schedule method and then whenever I run any command, I got the test in the console. Which means that's part of the lifecycle, so it is always invoked.

Activity icon

Replied to Event Listener Never Gets Called

@goldtaste and one last thing from me :)

Have you tried using the browser by hitting a route, instead of just using tinker?

Will this call the listener? from any route just add this:

event(new ResponseSetCreated);

?

Activity icon

Replied to Event Listener Never Gets Called

@goldtaste that's really weird. I've searched a bit, and seen people using:

composer dump-autoload

then

php artisan clear-compiled

and that did the trick for them.

Activity icon

Awarded Best Reply on Dd() Not Showing Results Correctly

@cservices those are not expandable if the result returns many records :) you should limit the records to 100 for example then you will be able to expand the fields.

Activity icon

Awarded Best Reply on Laravel Collective - Different Label Name And Input Name

@dicanio so definitely the problem is in the way the component is built. You can pass the label as an attribute in the $attributes array maybe:

So in your: components/form/text.blade.php

{{ Form::label($name, $attributes['label'] ?? null, ['class' => 'control-label']) }}

Then to use it:

{{Form::bsText('name', '', ['placeholder' => 'Podaj imię', 'label' => 'Podaj imię'])}}

Let me know if it works :)

Activity icon

Replied to Dd() Not Showing Results Correctly

@cservices those are not expandable if the result returns many records :) you should limit the records to 100 for example then you will be able to expand the fields.

Activity icon

Replied to Laravel Collective - Different Label Name And Input Name

@dicanio so definitely the problem is in the way the component is built. You can pass the label as an attribute in the $attributes array maybe:

So in your: components/form/text.blade.php

{{ Form::label($name, $attributes['label'] ?? null, ['class' => 'control-label']) }}

Then to use it:

{{Form::bsText('name', '', ['placeholder' => 'Podaj imię', 'label' => 'Podaj imię'])}}

Let me know if it works :)

Activity icon

Awarded Best Reply on Nullable With Unique

@aronaman ah, now I see. So do you want only one company_account to exists with null value in the database?

Using MySQL you will have to manually check that if that's the case:

$model = Model::whereNull('company_account')->first();

if($model)
{
    return back()->with('status', 'Company account already taken'); 
}

Something like this would do it, just change Model with your model where you have the company account field.

Activity icon

Replied to Event Listener Never Gets Called

@goldtaste I just tried to recreate your event and listener into my project.. For some reason PHPStorm acts weirdly when I create an event with name ResponseSetCreated.. Tried creating an event with just TestEvent works great, but for some reason with that name the page is completely broken with no clue on why is that.

So can you please try renaming the event, and try that? Because everything else seems okay to me.