krystian2160

krystian2160

Member Since 1 Year Ago

Experience Points 43,250
Experience
Level
Lessons Completed 425
Lessons
Completed
Best Reply Awards 0
Best Answer
Awards
  • Start Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

24 May
7 months ago

krystian2160 left a reply on Asserting The CurrentUrl?

But I don't mind laravel dusk tests or other browser tests. Just HTTP tests.

23 May
7 months ago

krystian2160 started a new conversation Asserting The CurrentUrl?

I have tests with the $this->followingRedirects();.

Is there a way to assert the current url? After the redirection? Current url of the response.

21 May
7 months ago

krystian2160 left a reply on Laravel - When Hitting Web Route Twice In One Test (get Request)

As I said, everything is fine and gut if i remove these 2 lines

$response = $this->get(route('home'));
        $response->assertSee($goal->name);

As if loads the same view as before, where we can See but we have to not See :) and we doesn't see. It just somehow... sees this

krystian2160 left a reply on Laravel - When Hitting Web Route Twice In One Test (get Request)

Still. $response->assertDontSee($goal->fresh()->name);

It fails in this assertion. :)

krystian2160 left a reply on Laravel - When Hitting Web Route Twice In One Test (get Request)

[$user, $goal] = $this->newUserWithNewGoal();
        $text = $this->uniqueText();
    
        $response = $this->get(route('home'));
        $response->assertSee($goal->name);
    
        $this->post(route('commit.store', $goal), [
            'text' => $text,
            'done' => 3,
        ]);
        
        $this->assertTrue($goal->fresh()->done == 3);
    
        $this->refreshApplication();
        Auth::login($user);
        $response = $this->get(route('home'));
        $response->assertDontSee($goal->name);
        $response->assertStatus(Response::HTTP_OK);

krystian2160 started a new conversation Laravel - When Hitting Web Route Twice In One Test (get Request)

Earlier in the test I have

$response = $this->get(route('home'));
$response->assertSee($goal->name);
Then some action, other lines of code

And then

$response = $this->get(route('home'));
$response->assertDontSee($goal->name);
And the assertion fails. But it shouldn't. It works great! And when I remove earlier two lines of code, I mean:
$response = $this->get(route('home'));
$response->assertSee($goal->name);

Now tests green and everything is fine.

I don't know what this is about, but I guess it's because it hits route('home') twice in the same test. As view is cached? As it gets the same output as before despite the new get request?

I don't know. Tried many things, e.g. $this->refreshApplication(); with no green result. Tried also Artisan::call('view:clear');, still the same.

What to do? What is this about?

19 May
7 months ago

krystian2160 left a reply on Laravel - Custom SetUp Method Only In Parent Class - Testing

Thank you, you made me realize something. The problem was wrong use import, wrong class. I mean, class ok... but with wrong namespace. Sad. That there is a use App\Http\Middleware\VerifyCsrfToken; and use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken; -.-, easy to make a mistake, two VerifyCsrfToken

18 May
8 months ago

krystian2160 left a reply on Laravel Testing - PHPUnit And PHP Fatal Error: Allowed Memory Size

This is my setUp

protected function setUp()
    {
        parent::setUp();
        $this->withoutMiddleware([VerifyCsrfToken::class]);
        $this->followingRedirects();
    }

krystian2160 started a new conversation Laravel Testing - PHPUnit And PHP Fatal Error: Allowed Memory Size

...........\php.exe ............../phpunit --configuration .............\phpunit.xml --teamcity
Testing started at 18:53 ...
PHPUnit 7.1.5 by Sebastian Bergmann and contributors.

PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 790528 bytes) in E:\XAMPP\htdocs\trzypoziomy\vendor\fzaninotto\faker\src\Faker\Provider\Text.php on line 84
PHP Stack trace:
PHP   1. {main}() E:\XAMPP\htdocs\trzypoziomy\vendor\phpunit\phpunit\phpunit:0
PHP   2. PHPUnit\TextUI\Command::main() E:\XAMPP\htdocs\trzypoziomy\vendor\phpunit\phpunit\phpunit:53
PHP   3. PHPUnit\TextUI\Command->run() E:\XAMPP\htdocs\trzypoziomy\vendor\phpunit\phpunit\src\TextUI\Command.php:151
PHP   4. PHPUnit\TextUI\TestRunner->doRun() E:\XAMPP\htdocs\trzypoziomy\vendor\phpunit\phpunit\src\TextUI\Command.php:198

I have something like this after running many tests and assertions. What to do with it? Is it okay to have this kind of error in testing? And the right solution is to higher the memory?

17 May
8 months ago

krystian2160 left a reply on Laravel - Custom SetUp Method Only In Parent Class - Testing

Errors of 419 status code, or that something cannot be seen or that something is not seen in DB...

krystian2160 left a reply on Laravel - Custom SetUp Method Only In Parent Class - Testing

Tried tests again, both line matters. $this->followingRedirects(); and $this->withoutMiddleware([VerifyCsrfToken::class]);

krystian2160 left a reply on Laravel - Custom SetUp Method Only In Parent Class - Testing

Yea, it fails every test after pulling this setUp to upper class

krystian2160 left a reply on Laravel - Custom SetUp Method Only In Parent Class - Testing

Tests are failing, e.g. got 419 errors - that corresponds to followingRedirects or withoutMiddleware I don't remember exactly now but I think it is it - withoutMiddleware

And maybe other errors, didn't try all tests

krystian2160 started a new conversation Laravel - Custom SetUp Method Only In Parent Class - Testing

My test's custom setUp method looks like this:

protected function setUp() { parent::setUp(); $this->withoutMiddleware([VerifyCsrfToken::class]); $this->followingRedirects(); } I have a class of MyTestCase that extends the default laravel's TestCase

abstract class MyTestCase extends TestCase

I have pushed up many methods and traits use.

But I cannot push this one setUp method. After that everything blows up.

Is it possible to have this setUp method I showed you at the beginning only in my MyTestCase?

Because now I have to duplicate this setUp method in all of my test's classes in order them to work.

14 May
8 months ago

krystian2160 left a reply on Assert Not Soft Deleted? Inverse? - Laravel Tests

Haha, I agree. Totally forgot about asserFalse XD haha. Yea :D assertTrue with "!" stupid :D

krystian2160 started a new conversation Assert Not Soft Deleted? Inverse? - Laravel Tests

Laravels test suite has an assertion called

$this->assertSoftDeleted() But is there the inverse? To assert that something is not soft deleted?

I've tried assertDatabaseHas but doesn't work.

I have done it this way $this->assertTrue(! $goal->fresh()->trashed());

Works perfect.

But is there another, better, more ---elegant--- and laravel's way?

06 Nov
1 year ago

krystian2160 started a new conversation Annyoing Bugs With Completing Series And Incomplete Series

When I check to see only incomplete + series I get mix of those... some completed doesn't show and some show. Ugh. That's really annoying and it's a bug.

Plus when I click on series to complete It should complete all episodes of this particular series, but It doesn't. Each episode of the serie is still marked as unwatched and I have to go and mark them manually, each one.

Plus only when I do this - there is just a "chance" that this serie will disappear from uncompleted + series... Only chance. Because it one times happens, other not.

@JeffreyWay

Please fix laracasts bugs :)

14 Oct
1 year ago

krystian2160 started a new conversation Jeffrey's Font For Classes And Maybe Something More In PHPStorm

What is the setting that Jeffrey uses and font, that when he types Class name (maybe other things too) it has special font and exactly this font, and... Just exactly how to + what font

10 Oct
1 year ago

krystian2160 started a new conversation Laravel-mix Doesn't Compile Anything - Xampp, Windows 7

Laravel-mix doesn't compile anything - Xampp, Windows 7

https://stackoverflow.com/questions/46671709/laravel-mix-on-windows-doesnt-compile-saas-no-errors-in-cmd

Link to stack because I can't post pictures in here and so on

26 Sep
1 year ago

krystian2160 left a reply on Jeffrey's Macro For Class Field/property In PHPstorm

@ChrisSFR but it's something better, I saw this.

But many times in many series we can see he has event better macro I think

08 Sep
1 year ago

krystian2160 left a reply on Laravel 5.5 So Slow. Using Windows 7 And Xampp. Why? How To Make This Right?

Tried with nginx. On xampp 1s Nginx 100-200ms

But still far from 1-10 ms

krystian2160 left a reply on Laravel 5.5 So Slow. Using Windows 7 And Xampp. Why? How To Make This Right?

I saw many users here have loading time of 1-10 ms. So mine ~ 1 second makes me worried

06 Sep
1 year ago

krystian2160 left a reply on Laravel 5.5 So Slow. Using Windows 7 And Xampp. Why? How To Make This Right?

@Abid with 5.4 I have the same :), I had 5.4 at first, then Upgraded to 5.5

05 Sep
1 year ago

krystian2160 started a new conversation Laravel 5.5 So Slow. Using Windows 7 And Xampp. Why? How To Make This Right?

I am using laravel 5.5, windows 7 and Xampp, below I attached print screen and you can see how much slow this is, how to make this right and improve it? What is the problem here? I think it is something with xampp

http://i.imgur.com/uaXvWqc.png

19 Aug
1 year ago

krystian2160 left a reply on Still Getting Old Whoops On Upgrade From 5.4 To 5.5

It is not solved. This is problem, in documentation was nothing about adding ""filp/whoops": "~2.0"," to composer.json file.

And you should add it, then it works.

Upgrade documentation isn't complete, doesn't provide full upgrade with everything that is new.

The same with laravel dusk (if missing in composer.json (5.4 have it, 5.5 doesn't in this file) )

krystian2160 started a new conversation Still Getting Old Whoops On Upgrade From 5.4 To 5.5

Still getting old whoops on upgrade from 5.4 to 5.5

But when creating new laravel project it works.

Probably not only new whoops is missing when doing upgrade. :<

18 Aug
1 year ago

krystian2160 started a new conversation Laravel Can Authorization With Gate Doesn't Work

I have something like this in view:

@can('sendMessage', $uzytkownik) Wyślij prywatną wiadomość @endcan and this in AuthServiceProvider

Gate::define('sendMessage', function($user, $to) { return 1; //return $to->id !== $user->id AND $to->status === 1; }); //return 1; is for testing why it doesn't work... but I can't find out.

Button isn't seen although we have return 1;, should be always visible.

When I change can to @can('sendMessage') I have error, - to few arguments.

So it see this and work with it

I get it back and then change can to @can('sendMessage') and Gate to Gate::define('sendMessage', function($user)

Now works, and button is seen...

What is going on here? When I got this 2 arg it doesn't work properly

Although this $to thing that we send in view as $uzytkownik is proper users Eloquent Model. All should work

{{ dd(\Illuminate\Support\Facades\Gate::check('sendMessage', $uzytkownik)) }} gives 'false'... we got return 1. What is going on > . >

{{ dd(\Illuminate\Support\Facades\Gate::check('sendMessage', auth()->user(), $uzytkownik)) }} gives false too...

all on return 1, false...

16 Aug
1 year ago
15 Aug
1 year ago

krystian2160 started a new conversation Jeffrey's Macro For Class Field/property In PHPstorm

Sometimes Jeffrey uses this macro, that he type in constructor params fieldname and it creates automatically in constructor and adds to class as new protected property

How to do it? Can't find it anywhere