knubbe

knubbe

Web Developer at KNUBBE CODING

Member Since 3 Years Ago

Experience Points
36,430
Total
Experience

3,570 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
337
Lessons
Completed
Best Reply Awards
0
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 8
36,430 XP
Jul
30
1 week ago
Activity icon

Replied to Custom Exception For Delete Entity With Relation

can you be more specific

Activity icon

Started a new Conversation Custom Exception For Delete Entity With Relation

Is there a way to create a custom Exception and message that I want to return as flash for deleting entities with relations. For example if entity (model) has relationship data I want to send exception message like

try {
        $center->delete();
} catch (Exception $exception) {
        return notify()->warning($exception->getMessage());
}
            	

and instanceof that exception must be QueryException

May
23
2 months ago
Activity icon

Awarded Best Reply on Can't Connect To Database With Db Client [08001]

I finally figure out. For homestead on linux you need to pass this credentials:

host: 192.168.10.10

instead of 127.0.0.1 or localhost

Activity icon

Replied to Can't Connect To Database With Db Client [08001]

I finally figure out. For homestead on linux you need to pass this credentials:

host: 192.168.10.10

instead of 127.0.0.1 or localhost

May
22
2 months ago
Activity icon

Replied to Can't Connect To Database With Db Client [08001]

Access denied for user 'homestead'@'localhost' (using password: YES)

Activity icon

Replied to Can't Connect To Database With Db Client [08001]

Public Key Retrieval is not allowed

Activity icon

Replied to Can't Connect To Database With Db Client [08001]

I am trying to setup a connection with DBeaver after I vagrant up. In vagrant I was not able to connect to mysql with root as user from command line. I can connect with mysql -u homestead - p where password is secret

Activity icon

Replied to Can't Connect To Database With Db Client [08001]

When I use ssh with credentials that you shere I got this: Access denied for user 'root'@'localhost' (using password: NO)

Activity icon

Replied to Can't Connect To Database With Db Client [08001]

why is your username root and port 3306 instead of 33060 and for ssh how you use vagrant for username and password

Activity icon

Replied to Can't Connect To Database With Db Client [08001]

I am using right credentials. On macOs I setup easily but I can't on linux ubuntu 20.04.

Activity icon

Started a new Conversation Can't Connect To Database With Db Client [08001]

I am using laravel homestead on linux and when I want to connect to database with phpstorm or DBeaver I receive:

[08001] Could not create connection to database server. Attempted reconnect 3 times. Giving up.
Index 5 out of bounds for length 5.

I investigate and find that problem could be with jdbc driver but all of my drivers are up to date. On homestead I use mysql 5.7 and both (phpstrom and DBeaver) are up to date.

May
01
3 months ago
Activity icon

Replied to How To Add A File To SerializeArray

It's empty with FormData

Activity icon

Started a new Conversation How To Add A File To SerializeArray

I have a wizard with different forms on every step. In one of the steps I have cropper for images and on next step I want to send crop data to controller method but I can't add that to serializeArray. This is my js part:

wizard.on('beforeNext', function (wizardObj) {
	wizardObj.stop();
        let wizardForm = $('#kt_form_' + wizardObj.currentStep)
        let dataForm = wizardForm.serializeArray()
        if (wizardObj.currentStep == 2) {
        	canvas = cropper.getCroppedCanvas({
                	width: 160,
                        height: 160,
                });
               canvas.toBlob(function (blob) {
                       url = URL.createObjectURL(blob);
                       var reader = new FileReader();
                       reader.readAsDataURL(blob);
                       reader.onloadend = function () {
                       		var base64data = reader.result;
                                dataForm.push({ name: "cropImage", value: base64data });
                            }
                       });
               }

              let url = wizardForm.attr('action')
              let method = wizardForm.attr('method')
              $.ajax({
                   url: url,
                   type: method,
                   data: dataForm,
              }).done(function (response) {
                    wizardObj.goNext();
              })

When I console log a dataForm I see that I have cropImage attribute but on controller method it's not part of request when I dd($request->all())

Apr
21
3 months ago
Activity icon

Replied to Laravel Forge Deployment Fail With Php 7.4 Typed Property On User Model

My IDE (storm) change vendor HasAttributes trait and set array type to all properties and because of that in local everything works fine. Delete vendor, composer install and return User model to default save my day ;)

Apr
19
3 months ago
Activity icon

Started a new Conversation Laravel Forge Deployment Fail With Php 7.4 Typed Property On User Model

I create fresh new project in Laravel 7 with php 7.4 and on User model I have this properties:

* The attributes that are mass assignable.
     *
     * @var array
     */
    protected array $fillable = [
        'name', 'email', 'password',
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected array $hidden = [
        'password', 'remember_token',
    ];

    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected array $casts = [
        'email_verified_at' => 'datetime',
    ];

and on Laravel Homestead everything works fine but when I want to deploy app with Laravel Forge on UserSeeder I got this message:

PHP Fatal error:  Type of App\User::$casts must not be defined (as in class Illuminate\Foundation\Auth\User)
Mar
07
5 months ago
Activity icon

Replied to Unique String Attribute With Special Character

I am using utf8 on mysql 5.7. Which one do I need?

Activity icon

Started a new Conversation Unique String Attribute With Special Character

I have a field registration in my migration file and it looks like this:

$table->string('registration')->unique();

but when I have similar, but not exactly the same one strings, it breaks. It looks like that the problem is with special char and this two strings are the same BG 863 ČŠ and BG 863 ČS but it should not be.

Feb
09
6 months ago
Activity icon

Started a new Conversation How To Get Latest Records Based On Two Foreign Id

I have a CenterService entity (table center_services) and there is two columns center_id and service_id.

I have an array of services ids and I need collection in return but without of duplication center_id and service_id. I only need last record of that combination.

This is how I try:

$requiredServices = Service::whereRequiredService(true)->pluck('id');

return CenterService::whereIn('service_id', $requiredServices)->latest()->get();

but it's just order that collection with all duplicate data.