realtebo

realtebo

Member Since 2 Years Ago

Experience Points
11,750
Total
Experience

3,250 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
85
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.

Level 3
11,750 XP
Nov
07
6 days ago
Activity icon

Started a new Conversation Back()->with() Looses Messages Saved

I a route (an action of a controller) I ends with

 return back()->with('custom_message',  'something to say to user')

And i the blade that is rendered I do

@if ( session('custom_message') )
    <div class="alert alert-danger">
        {{ session('custom_message') }}
    </div>
@endif

I absolutely do not see nothing.

So I tried to dunp session and I says this

"_flash" => array:2 [▼
    "old" => array:1 [▼
      0 => "custom_message"
    ]
    "new" => []
  ]

Why my flashes are in the old bucket instead of inside the new one?

Nov
04
1 week ago
Activity icon

Replied to Laravel And MySQL Timezone

So, can we use timezone filed of our 'mysql' configuration to force a specific timezone?

How, for example, set 'utc' ?

I tried

'timezone' => "UTC",

But I got an error

SQLSTATE[HY000]: General error: 1298 Unknown or incorrect time zone: 'UTC'

Oct
31
1 week ago
Activity icon

Replied to Chaining Collection Methods: Results Differs When Called Differently

Thanks for explanation, I didn't catch the fact that transform mutates , thanks!

Oct
30
2 weeks ago
Activity icon

Replied to Chaining Collection Methods: Results Differs When Called Differently

The problem was that the result set returned from calling the method was NOT sorted as I expected,

I discovered that

public static function foodMenuConfig($column)
{
    $data = collect(self::familyConfiguration())
            ->whereStrict('food_menu_col', $column)
            ->sortBy('food_menu_order');
    return $data ->transform(function($item) {
                return $item["label"];
            })
    ;
}

Is right

but

public static function foodMenuConfig($column)
{
    $data = collect(self::familyConfiguration())
            ->whereStrict('food_menu_col', $column)
            ->sortBy('food_menu_order') 
            ->transform(function($item) {
                return $item["label"];
            })
    ;
}

Is wrong

So, note that, in the right version, I assigned sorted data to $data var before apply transform() and returning the result set.

I discovered solution here

https://stackoverflow.com/a/55394634/1055279

Activity icon

Started a new Conversation Chaining Collection Methods: Results Differs When Called Differently

Imagine this chain:

return collect(self::familyConfiguration())
            ->whereStrict('food_menu_col', $column)
            ->sortBy('food_menu_order')
        ->transform(function($item) {
                return $item["label"];
            })

in a method.

I discovered that calling directly the chain in tinker, it returns same result set but in different order!

collect(self::familyConfiguration())
            ->whereStrict('food_menu_col', $column)
            ->sortBy('food_menu_order')
        ->transform(function($item) {
                return $item["label"];
            })

The second way give the right results, the first one looks like is not sorting at all

Oct
24
2 weeks ago
Activity icon

Started a new Conversation How To Use Cypress.io To Test A Laravel App?

I would like to give a try to Cypress to test a laravel ap..

Do you know a good tutorial about it?

A part this, I ask you how to accomplish the 'reset' of db before each test session. I thinks it's a common problem.

I have a dedicated test server with a dedicated db, so I can have a fresh copy of production with real data, then test my code in a real environment; now I register users, make orders, acting as admin I do steps to send goods to users, etc... I can do this already now after one day of studying Cypress...

But my question is ... how I can reset now my test environment for next test session without having to redploy the db?

or ... better ... is there a way to automatize db snapshotting and restore ? or similar strategies?

I cannot simply think of day by day , test by test, delete new roww before running new test session

Oct
21
3 weeks ago
Activity icon

Started a new Conversation How To Make Form?

Is there something of official or highly recommended to create forms in Laravel 6?

illuminate\html is died and collective html was born collective html is died, also.

and now?

Must we create form 100% manually?

Normally this is not a problem, but today I'm facing a form with 35 text fields, no one 100% identical to other for html attributes, so I'm not creating a laravel blade component, because it will be full of 'if' ... and also .. if there is something premade, it could be a lot better of what I am doing....

Oct
14
4 weeks ago
Activity icon

Replied to Migration: How To Execute Only In Development?

Yes, I'm developing a local smtp acting as mailtrap.io. You can send mail through it, but it saves email in a db table and has a gui to inspect, delete...

I'm on a very early stage, but it works.

It's intended to be used only on development, but instead of create a standalone app we prefer to use per-project,.

Activity icon

Started a new Conversation Migration: How To Execute Only In Development?

I'm creating a very specific use-case package for laravel. My package is adding a migration, but I absolutely must ensure that migration is NEVER executed if not in development environment.

Is there a way to allow a migration only on dev?

I think to test if .env === 'local', and do the migration only if this is true. In case of false, I simply return true to allow deploy flow to not be changed in any way.

Is there a more beautiful way? Or do you know any potential issues ?

Oct
04
1 month ago
Activity icon

Replied to [L5.7] InvalidArgumentException : No Connector For []

OMG, in my case this EXACT problem and error was caused from my command line in supervisor.

I have used queue:work with --timeout = 360 (note the spaces !)

After removing spaces and updated/restarted supervisored processes, all works.

Sep
06
2 months ago
Activity icon

Replied to Logging Config Ignores Permissions

Damn, I forgot to write here down that:

permissions should simply be permission, without the ending s

Sep
05
2 months ago
Activity icon

Started a new Conversation Logging Config Ignores Permissions

My config


'default' => env('LOG_CHANNEL', 'stack'),

'channels' => [
        'stack' => [
            'driver' => 'stack',
            'channels' => ['daily'],
            'ignore_exceptions' => false,
        ],
....
        'daily' => [
            'driver' => 'daily',
            'path' => storage_path('logs/laravel.log'),
            'level' => 'debug',
            'days' => 14,
            'permissions' => 0664
        ],
.....
]

My problem is that new files are being created with permissions '644' instead of 664 as I requested.

What am I doing wrong?

I already did php artisan config:cache and deleted file to try.

Sep
03
2 months ago
Activity icon

Started a new Conversation Maintenance Mode: How To Return A Json When Called /api/* Routes?

All my APIs return json.

I created a catch-all for api/* routes to return a json equivalent of 404

I wanto my website be able to return a json also when in maintenance mode. Actually it returns an html page.

Is there a way?

Aug
28
2 months ago
Activity icon

Replied to Delay Between Processes In Job Queue

In situation like this, you could switch to using cron and schedule a check every minute. Inside that check, you could do the for loop with sleep

May
13
6 months ago
Activity icon

Started a new Conversation After Upgrading To 5.8, &euro; Is Printed Litterally

I've this helper

function currency($value, $euro = true, $decimal = 2)
{
    return ($euro ? '&euro; ' : '') . number_format($value, $decimal, ',', '.');
}

I'm using in my blades, since project started with a v5.4, like this

<td nowrap="" class="">
    {{ currency($record->purchase_list_price) }}
</td

Before upgrading, I was getting printed on my webpage

 €21.02

Now I get

  &euro;21.02

Why? What's changed and how to avoid this escaping?