Kandown

Kandown

Member Since 4 Years Ago

Bansk√° Bystrica, Slovakia

Experience Points 395
Experience Level 1

4,605 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 320
Lessons
Completed
Best Reply Awards 0
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.

22 Nov
2 years ago

Kandown left a reply on TDD - How To Test Controller Validation?

@EliasSoares I've solved this in a dirty way. Wondering about a pull request after a cleanup.. Thank you very much for your response. Below is my working example..

Usage:

$this->post(route('profile.change-password'), [
    'old_password' => 'password',
    'password' => $password,
    'password_confirmation' => $password
]);

$this->hasValidator('old_password', 'required');
$this->hasValidator('password', ['required', 'min:6', 'confirmed']);

Implementation

protected function hasValidator($field, $rule)
{
    $controllerWithMethod = explode('@', app('router')->current()->getActionName());
    $controller = $controllerWithMethod[0];
    $method = $controllerWithMethod[1];

    $rules = [];
    $refleciton = new ReflectionMethod($controller, $method);

    // foreach method parameters
    foreach ($refleciton->getParameters() as $parameter) {
        // is instance of form request
        if ($parameter->getClass()->isSubclassOf(\Illuminate\Foundation\Http\FormRequest::class)) {
            // has method rules
            if ($parameter->getClass()->hasMethod('rules')) {
                try {
                    $request = app($parameter->getClass()->getName());
                    foreach ($request->rules() as $f => $r) {
                        $rules[$f] = explode("|", $r);
                    }
                } catch (\Illuminate\Validation\ValidationException $e) {
                    $rules = $e->validator->getRules();
                }
            }
        }
    }

    self::assertArrayHasKey(
        $field,
        $rules,
        "\e[0;33mField [{$field}] has no validation rules applied.\e[m"
    );

    if (is_array($rule)) {
        foreach ($rule as $r) {
            self::assertTrue(
                in_array($r, $rules[$field]),
                "\e[0;33mField [{$field}] does not have a validation rule [{$r}] applied.\e[m"
            );
        }
    } else {
        self::assertTrue(
            in_array($rule, $rules[$field]),
            "\e[0;33mField [{$field}] does not have a validation rule [{$rule}] applied.\e[m"
        );
    }

    return $this;
}
19 Nov
2 years ago

Kandown left a reply on TDD - How To Test Controller Validation?

I'm having the same issue. Hope someone more skilled will help to solve this. I would also appreciate to be able to test if the given validation rule was applied on the request.

20 Nov
3 years ago

Kandown started a new conversation Laravel Homestead Gettext

I was asked to make the gettext running on our projects instead of the default translation in Laravel. I ran into a problem because there needs to be a gettext extension enabled. I'm not really into a servers so I'm asking for a bit help.

Thank you

10 Feb
4 years ago

Kandown left a reply on Theme. Where Should I Put CSS And JS

@cboxdk Yeah. Exactly :) All your public folder is public. Other folder should be private and user or visitor should not have access to them. But this is just my humble opinion. You can structure your assets as you need to :)

Kandown left a reply on Theme. Where Should I Put CSS And JS

I recommend you to put your "working" files in the assets. All your sass, coffee, etc. should be in assets folder and you should compile them into the public folder. Assets folder should not be accessible by http request. Just your application should use it. In public folder you would have all your compiled and minified scripts for production.

Kandown started a new conversation Assets Loaded Only From Last Booted Package

Hi, I'm trying to build some packages and I stucked at this issue. I got two packages, two service providers for each. In service provider I put some stuff to be loaded after ServiceProvider is registered

public function boot() {

        include __DIR__ . '/Http/routes.php';

        $this->loadViewsFrom(__DIR__ . '/resources/views', 'users');
        $this->loadTranslationsFrom(__DIR__ . '/resources/lang', 'users');

        $this->publishes([
            __DIR__ . '/resources/views' => base_path('resources/views/modules/users'),
            __DIR__ . '/resources/lang' => base_path('resources/lang')
        ]);
    }

This works fine untill I register the second package, which has also some views and translations etc. My config/app service providers looks like this.

// Other service providers...

'Modules\Users\UsersServiceProvider',
'Modules\Comments\CommentsServiceProvider',

Assets are loaded just from the Comments module. If I change the order in the config/app and Users are the last loaded ServiceProvider, then assets are loaded from Users.

Do you have any tips how to solve this, please?

25 Jan
4 years ago

Kandown left a reply on Workbench Command Is Not Found In L5

Any news about the substitution of workbench? :)