Nakov

Nakov

at SOLID Solutions

Member Since 5 Years Ago

Skopje

Experience Points
771,090
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
1800
Lessons
Completed
Best Reply Awards
982
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.

Level 50
771,090 XP
Oct
30
18 hours ago
Activity icon

Replied to Update Laravel 7.x To 8.x

That's not an error but warning instead. Here is a better explanation: https://stackoverflow.com/a/26198229/1457270

Oct
29
1 day ago
Activity icon

Awarded Best Reply on Bootstrap Modal Help - Route Link Not Working

@randy_johnson you need to close the form once, and only below the submit button, you have this: </form> immediately after you open the form, so remove that.

  • You are missing, method="post" and @csrf and @method('PATCH') or however you defined your route.
Activity icon

Replied to Bootstrap Modal Help - Route Link Not Working

@randy_johnson you need to close the form once, and only below the submit button, you have this: </form> immediately after you open the form, so remove that.

  • You are missing, method="post" and @csrf and @method('PATCH') or however you defined your route.
Activity icon

Replied to Bootstrap Modal Help - Route Link Not Working

You cannot have href attribute on a button that's an anchor attribute ie <a>

So you need to have:

<a href="{{ route('welcome') }}">Welcome</a>
Activity icon

Replied to Routing Fail After Changing View In Folder

@gillesdeb you are missing return view('user.profile') now wherever you reference the view. From the routes I cannot see that, but it is part of any of your controllers.

Oct
28
2 days ago
Activity icon

Replied to Reset Password Or Password Verification

What does an automated means? If you mean by is the email good to go out of the box yes.

But you for sure need to use either mailgun or any other email service. You have mailchimp, sendgrid and many others to name a few.

Oct
27
3 days ago
Activity icon

Replied to Passing Wildcards To RouteServiceProvider

@rossiluca the LoginController can use the property or a method in which you can add the intended redirect path:

public function redirectTo() 
{
    return Auth::user()->team_slug +  '/dashboard';
}

or override the authenticated method which is triggered after the user is authenticated:

protected function authenticated( Request $request, $user )
{
    return $user->team_slug +  '/dashboard';
}
Activity icon

Replied to Get ID From Object

How are you passing it to the component? Are you using :user="{{ $user }}" ?

Activity icon

Replied to 404 Error When Accessing Route

@shiro_ you have a parameter which is expected in your controller but you are not passing it. So change your method signature to this instead:

public function capture(Invoice $invoice, LabTestItem $lab_test_item)

without the $facility as you are not using it anyway.

But also the $lab_test_item will be required, and you are not passing that either.

So it should be something like this:

public function capture(Invoice $invoice)

based on your definition in the routes file.

Activity icon

Replied to Target [Repository] Is Not Instantiable While Building [Controller].

@kkhicher1 the issue here is that in your Repository constructor you accept TestResult which Laravel probably cannot instantiate because I guess in that class you also have a constructor which accepts some parameters.

So you will need to provide that, something like this:

$this->app->bind(TestResultRepositoryInterface::class, function($app)
{
     return new TestResultRepository(new TestResult);
});

this way you are telling Laravel how to instantiate the TestResult as well. It should work out of the box in case the TestResult has an empty constructor as the example above, but I doubt that it is much more complex.

Oct
26
4 days ago
Activity icon

Awarded Best Reply on Laravel Livewire Rules Array

@xtremer360 I think the problem is when using a property and a callback within, try using a method instead:

protected function rules() {
        return ['field' => [
            'integer',
            Rule::requiredIf(function () {
                return $this->category->hasARange();
            }),
        ]];
    }

it should do the same.

Activity icon

Replied to Laravel Livewire Rules Array

@xtremer360 I think the problem is when using a property and a callback within, try using a method instead:

protected function rules() {
        return ['field' => [
            'integer',
            Rule::requiredIf(function () {
                return $this->category->hasARange();
            }),
        ]];
    }

it should do the same.

Activity icon

Replied to Help With... Storage::disk('s3')->url($media->file);

@kvnkrft what does an invalid url() means?

Do you have set the correct url in your config/filesystems.php file:

under s3 you should have:

'url' => env('AWS_URL'),

then in your .env file you should have the base pat to your S3 instance.

Activity icon

Replied to Need Your Suggestion

Andre who is an instructor in laracasts has a series on building e-commerce site in Laravel, so take a look here: https://www.youtube.com/playlist?list=PLEhEHUEU3x5oPTli631ZX9cxl6cU_sDaR

Activity icon

Awarded Best Reply on Relationship Not Returning A Collection

@huzzahbeard you will not get a collection when there is a belongsTo relationship, because that means that you have one instance of a podcast.

Try this:

$ep->podcast;

without the () and you will get an instance of Podcast model.

As for the tags, getting it without the () it will return a collection of Tag class.

Activity icon

Replied to Relationship Not Returning A Collection

@huzzahbeard you will not get a collection when there is a belongsTo relationship, because that means that you have one instance of a podcast.

Try this:

$ep->podcast;

without the () and you will get an instance of Podcast model.

As for the tags, getting it without the () it will return a collection of Tag class.

Activity icon

Awarded Best Reply on Cant Get Laravel To Add A Hidden Form Element To The Database.

@jack2706 in your Exam in the $fillable array do you have module_id ? Or are you using $guarded = []?

Activity icon

Replied to Cant Get Laravel To Add A Hidden Form Element To The Database.

@jack2706 in your Exam in the $fillable array do you have module_id ? Or are you using $guarded = []?

Oct
25
5 days ago
Activity icon

Awarded Best Reply on ErrorException Undefined Index: Text (View: /Applications/XAMPP/xamppfiles/htdocs/afiaprime/resources/views/messaging/chat.blade.php)

@tomasosho you see your latestmessaging is also a collection, so you need to iterate over it in order to access the attributes on each message.

So your error is on this line $post->latestmessaging['text'] it should be:

@foreach($post->latestmessaging as $message)
<span> {{$message->text}} </span>
@endforeach
Activity icon

Replied to Is It Possible Send Direct Print To Printer In Laravel

@ashir_ali_butt, yup, I don't think there is one. Again because of security reasons.

Activity icon

Replied to ErrorException Undefined Index: Text (View: /Applications/XAMPP/xamppfiles/htdocs/afiaprime/resources/views/messaging/chat.blade.php)

@tomasosho you see your latestmessaging is also a collection, so you need to iterate over it in order to access the attributes on each message.

So your error is on this line $post->latestmessaging['text'] it should be:

@foreach($post->latestmessaging as $message)
<span> {{$message->text}} </span>
@endforeach
Activity icon

Replied to Is It Possible Send Direct Print To Printer In Laravel

@ashir_ali_butt

Unless your browser is in kiosk mode, you cannot do this for security reasons. No one will trust your application if it directly starts their printer.. You might want to save the file to a PDF instead of printing as well.

Activity icon

Awarded Best Reply on Error: Trying To Get Property 'quantity' Of Non-object

@ivanradojevic as you can see the response is an array, not an object, so use this instead:

ProductVariationOrder::create([
                'order_id' => $order->id,
                'quantity' => $item['quantity'],
                'product_variation_id' => $item['variation']['id'],              
            ]);
Activity icon

Replied to Error: Trying To Get Property 'quantity' Of Non-object

@ivanradojevic as you can see the response is an array, not an object, so use this instead:

ProductVariationOrder::create([
                'order_id' => $order->id,
                'quantity' => $item['quantity'],
                'product_variation_id' => $item['variation']['id'],              
            ]);
Oct
23
1 week ago
Activity icon

Replied to Laravel Request Array Doesn't Read All Inputs

@rafidahsan if there was no value in the second one, it will not be shown here.

Oct
22
1 week ago
Activity icon

Awarded Best Reply on Trying To Get Property 'avatar' Of Non-object

@mehrdad70 it seems like for some reason auth()->user()->profile returns null hence the error.

Can you have a user without a profile? If so, then check first on that or you can use the optional() helper like this:

optional(auth()->user()->profile)->avatar
Activity icon

Replied to Trying To Get Property 'avatar' Of Non-object

@mehrdad70 it seems like for some reason auth()->user()->profile returns null hence the error.

Can you have a user without a profile? If so, then check first on that or you can use the optional() helper like this:

optional(auth()->user()->profile)->avatar
Activity icon

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

Here is how: https://laravel.com/docs/master/routing#form-method-spoofing

so change the form method to post and then add the blade directive:

@method('put')

I don't like the echoes that you have in the view, but that's another topic. Please learn the basics in Laravel.

Activity icon

Awarded Best Reply on When Checking For Is Post Favorite, Returns False Even When The Post Is Favorite !

@princeoo7 Your favorites collection returns users, so I am not sure you are checking it correctly, because the User model does not have user_id I guess, but an id.. Maybe a better check would be this:

public function getIsMyFavAttribute()
{
   return $this->favorites->contains(User::find(1));
}
Activity icon

Replied to When Checking For Is Post Favorite, Returns False Even When The Post Is Favorite !

@princeoo7 Your favorites collection returns users, so I am not sure you are checking it correctly, because the User model does not have user_id I guess, but an id.. Maybe a better check would be this:

public function getIsMyFavAttribute()
{
   return $this->favorites->contains(User::find(1));
}
Oct
21
1 week ago
Activity icon

Awarded Best Reply on Change Laravel DataTable Text

@afoysal

Take a look at the documentation here: https://datatables.net/reference/option/infoCallback

So you can basically do this:

 $('#new_datatable').DataTable({
    "infoCallback": function( settings, start, end, max, total, pre ) {
        var api = this.api();
        var pageInfo = api.page.info();

        return start + '-' + end + ' of ' + pageInfo.pages;
    },

 ...
});
Activity icon

Replied to Change Laravel DataTable Text

@afoysal

Take a look at the documentation here: https://datatables.net/reference/option/infoCallback

So you can basically do this:

 $('#new_datatable').DataTable({
    "infoCallback": function( settings, start, end, max, total, pre ) {
        var api = this.api();
        var pageInfo = api.page.info();

        return start + '-' + end + ' of ' + pageInfo.pages;
    },

 ...
});
Activity icon

Awarded Best Reply on Remove Accessors From Object In Controller

@briana if you need array of ids only, then take advantage of the pluck method, like this:

$organisations = Organisation::where('name', 'LIKE', '%' . $searchOrgName . '%')->pluck('id');
Activity icon

Replied to How To Modify Or Extends {{ }} Functionalities.

@kevdev you can run any php function within the {{ }} it just echoes whatever you need..

So you can do this if it helps:

{{ explode('.', $post->content)[0] }}

but then again, I don't know your exact use-case. This might work for what you gave above, but I would do it in a more generic way to catch more cases. Also you can register a helpers.php file in your composer and add global functions like that which can be used from any php file in your project.

Or you can also limit the string length:

{{ strlen($post->content) > 10) ? substr($post->content, 0, 7) . '...' : $post->content }}
Oct
20
1 week ago
Activity icon

Awarded Best Reply on Reset Password Fails > Update Not Solved

@gillesdeb you are missing a name attribute on your field:

<input class="form-control" type="email" name="email"
                 id="emailaddress" required="" placeholder="Enter your email">

That's what's used on the backend to see if there is a value for the field.

Activity icon

Replied to Reset Password Fails > Update Not Solved

@gillesdeb you are missing a name attribute on your field:

<input class="form-control" type="email" name="email"
                 id="emailaddress" required="" placeholder="Enter your email">

That's what's used on the backend to see if there is a value for the field.

Activity icon

Replied to Reset Password Fails > Update Not Solved

@gillesdeb no, if you use those than it will be all good. I was answering your initial question, you changed it now.

So check your ForgotPasswordController and sendResetLinkEmail try to dd() within make sure that you are reaching that part.

Have you set MAIL_MAILER as a log within your .env file or whatever driver you are using?

Activity icon

Replied to Reset Password Fails > Update Not Solved

@gillesdeb but I don't see in your routes the named route recoverpassword so if you use {{ route('recoverpassword') }} it won't work.

Activity icon

Replied to Reset Password Fails > Update Not Solved

@gillesdeb when you are using {{ route('recoverpassword') }} that is not expecting from you to have a blade view with that name but a registered route with that name..

https://laravel.com/docs/master/routing#named-routes

as an example:

Route::get('password/reset', [ResetPasswordController::class, 'index'])->name('recoverpassword');	
Oct
19
1 week ago
Activity icon

Awarded Best Reply on Display Application Name Within String Laravel 8 Livewire Stack

@nicotravassos you are trying to use {{ within {{ you don't have to.. try this :

{{__('Open your authentication app and enter the code for: :name',  ['name' => config('app.name', 'Laravel')])  }}

or

{{ __('Open your authentication app and enter the code for: ') .  config('app.name', 'Laravel')  }}
Activity icon

Replied to Display Application Name Within String Laravel 8 Livewire Stack

@nicotravassos you are trying to use {{ within {{ you don't have to.. try this :

{{__('Open your authentication app and enter the code for: :name',  ['name' => config('app.name', 'Laravel')])  }}

or

{{ __('Open your authentication app and enter the code for: ') .  config('app.name', 'Laravel')  }}
Activity icon

Awarded Best Reply on Remove Password Confirmation On Register

The password confirmation is there for a reason. Imagine a user going in to register to your app, and made a mistake while typing the password. You will successfully register the user, but that user will not be able to login again since they will not know what mistake they made.

Anyhow, if you still want to remove the confirmation open the register.blade.php file in your views/auth folder, and remove this block:

<div class="mt-4">
     <x-jet-label value="Confirm Password" />
     <x-jet-input class="block mt-1 w-full" type="password" name="password_confirmation" required autocomplete="new-password" />
</div>

Then in App\Actions\Fortify you will find CreateNewUser.php remove 'confirmed' from the rules for the password field. And there you go.

Activity icon

Awarded Best Reply on Parameter To ShowRegistrationForm

@fabuy the error means that in the blade view, register.blade.php you have this code:

{{ route('register') }}

you need to pass the required parameter in there as well. And check other places where you use the named route.

Activity icon

Replied to Parameter To ShowRegistrationForm

@fabuy the error means that in the blade view, register.blade.php you have this code:

{{ route('register') }}

you need to pass the required parameter in there as well. And check other places where you use the named route.

Activity icon

Replied to Pagination: Redirect To Index

There is already an answer for this here: https://stackoverflow.com/a/47005704/1457270

Oct
18
1 week ago
Activity icon

Awarded Best Reply on Laravel 5.7.29 - Undefined Index: Email

@bosstone did you changed or missed something in the views?

In your register.blade.php file you are using $data['email'] perhaps, or whatever the name of the array is, but that field is missing, hence the error. This is a really generic error when an item is missing from an array, so make sure that you understand some basics before you move forward.

Activity icon

Replied to Laravel 5.7.29 - Undefined Index: Email

@bosstone did you changed or missed something in the views?

In your register.blade.php file you are using $data['email'] perhaps, or whatever the name of the array is, but that field is missing, hence the error. This is a really generic error when an item is missing from an array, so make sure that you understand some basics before you move forward.

Activity icon

Replied to Remove Password Confirmation On Register

The password confirmation is there for a reason. Imagine a user going in to register to your app, and made a mistake while typing the password. You will successfully register the user, but that user will not be able to login again since they will not know what mistake they made.

Anyhow, if you still want to remove the confirmation open the register.blade.php file in your views/auth folder, and remove this block:

<div class="mt-4">
     <x-jet-label value="Confirm Password" />
     <x-jet-input class="block mt-1 w-full" type="password" name="password_confirmation" required autocomplete="new-password" />
</div>

Then in App\Actions\Fortify you will find CreateNewUser.php remove 'confirmed' from the rules for the password field. And there you go.