slickness

slickness

Member Since 2 Years Ago

Experience Points
5,210
Total
Experience

4,790 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
11
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 2
5,210 XP
Jun
30
1 week ago
Activity icon

Started a new Conversation Routes Horizon And Websockets

I use Horizon and web sockets with Laravel. How can I allow access to the two services for administrators only? Do I just have to create a new middleware for this?

example:

/*
     * Dashboard Routes Middleware
     *
     * These middleware will be assigned to every dashboard route, giving you
     * the chance to add your own middleware to this list or change any of
     * the existing middleware. Or, you can simply stick with this list.
     */
    'middleware' => [
        'web',
        Authorize::class,
    ],
Jun
20
2 weeks ago
Activity icon

Started a new Conversation Select Neighboring Divs With Jquery

I have the following html structure:

<div id="pixel_1" class="pixelarea"></div>
<div id="pixel_2" class="pixelarea"></div>
<div id="pixel_3" class="pixelarea"></div>

each div is 10px wide and 10px high. The whole surface is 102 divs wide and 200 divs high.(1020 pixel wide and 2000pixel high)

This is my jquery function:

var getNumericPart = function(id) {
   var num = id.replace(/[^\d]+/, '');
   return num;
};

$('body').on('click','.pixelarea',function(e) {
   e.preventDefault();
   var id = getNumericPart($(this).attr('id')); //get only the number from the id
   var count = parseInt($("#selectedpixelsum").text());

       if($('#pixel_' +id).hasClass('selected')){
           $('#pixel_' +id).removeClass('selected');
           count--;
           $('#selectedpixelsum').html(count);
       }else{
           $('#pixel_' +id).addClass('selected');
           count++;
           $('#selectedpixelsum').html(count);
       }

});

How can I make sure that only adjacent divs can be selected? By this I mean the divs below, above and to the right and left of the selected divs.

May
14
1 month ago
Activity icon

Replied to Sort Posts And Count By Tag Combination

Yes, but taggable is my middle table. It's a polymorphic relation.

My problem is the database query. I do not know how to start it to get the right result.

Activity icon

Started a new Conversation Sort Posts And Count By Tag Combination

I need help with a database query.

I have posts and tags.

Posts table:

Scheme::create('posts', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->index();
            $table->text('body');
            $table->timestamps();
        });

Tag table:

Scheme::create('tags', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->unique()->index();
            $table->timestamps();
        });

taggables:

Scheme::create('taggables', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('tag_id')->index();
            $table->integer('taggable_id')->index();
            $table->string('taggable_type')->index();
            $table->timestamps();
        });

I want to sort the posts by the tags used and count how often the tag combination was used in all posts. I want to show the tag names and the number of posts.

Mar
01
4 months ago
Activity icon

Replied to Private File Handling

The code example is from an admincontroller which only admins have access to. I solve this with middleware for example.

public function __construct()
    {
        $this->middleware('auth:admin');
    }

But how can I output multiple image files in one function?

Activity icon

Started a new Conversation Private File Handling

When I store files like pictures, videos or other files, I do not store them in the public folder but in a private folder that is not publicly accessible. Because only certain users should have access to the files.

With the following example function, for example, I load the images and put them into the view... is this the right way or is there a better way that might take less loading time?

How can I output multiple images from a private folder?

public function thumbnailfeedback($uuid)
    {
        $feedbackimage = FeatureRequest::findOrFail($uuid);
        $thumbnail = storage_path($feedbackimage->image_thumbnail);

        return Image::make($thumbnail)->response();
    }
Feb
23
4 months ago
Activity icon

Replied to Laravel Groupby And Count Different Values (Polymorphic)

@bobbybouwmann Can you give me an example, please?

Feb
22
4 months ago
Activity icon

Started a new Conversation Laravel Groupby And Count Different Values (Polymorphic)

I have a table with the name "reportable" and want to display the entries in a table on the website. Unfortunately I can't get the database query right, I don't have much experience with a One To Many (Polymorphic) table.

databse table:


    Schema::create('reportable', function (Blueprint $table) {
                $table->bigIncrements('id');
                $table->integer('user_id')->unsigned()->nullable()->index();
                $table->foreign('user_id')->references('id')->on('users')->onDelete('set null');
                $table->integer('reason');
                $table->integer('reportable_id')->index();
                $table->string('reportable_type')->index();
                $table->text('notice')->nullable();
                $table->tinyInteger('status')->default(0)->index();
                $table->timestamps();
            });

In the table on the web page I want to display only entries with the same reportable_id and reportable_type only once.

In addition, the entries with the same reportable_id and reportable_type should be counted and displayed as a numerical value.

In addition, the entries in the column 'reason' with the same reportable_id and reportable_type should be counted and displayed with the respective entry and as a numerical value.

Feb
08
5 months ago
Activity icon

Started a new Conversation Counting Of Unique Entries Of 2 Columns

I have the following table:

Schema::create('tracks', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('user_id')->unsigned()->nullable()->index();
            $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
            $table->string('ip');
            $table->string('session');
            $table->string('roboname')->nullable();
            $table->string('language');
            $table->string('referer');
            $table->string('referer_path');
            $table->string('device');
            $table->string('screensize');
            $table->string('browser');
            $table->string('browser_version');
            $table->string('os');
            $table->string('os_version');
            $table->string('url');
            $table->string('full_url');
            $table->boolean('is_mobile');
            $table->boolean('is_tablet');
            $table->timestamps();
        });

i want to count all unique entries of session and path. What is the best way to do this?

example:

session | path 123 /test 123 /test1 123 /test 321 /test 321 /test

The result here would be 3.