d3xt3r

d3xt3r

Member Since 3 Years Ago

Experience Points 136,980
Experience Level 28

3,020 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 291
Lessons
Completed
Best Reply Awards 323
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.

20 Aug
2 years ago

d3xt3r left a reply on How To Upgrade From 5.4 To 5.5?

How can I upgrade laravel V 5.4 to 5.5?

Please wait till official documentations are in place ...

14 Aug
2 years ago

d3xt3r left a reply on Service Provider Register() And Provides()

I've seen it done a few ways, and I don't fundmentally understand the differences:

You need to read between the lines and figure this out ... Just, for this particular case let me elaborate ...

  1. You are registering a singleton service with the IoC which can be located \ resolved by the name tabs. When any such request is received by IoC, an instance of Manager class is instantiated and stored for future calls. Using $app->make() allows for any further DI in the Manager's construction.

  2. Similar to 1 except that the name/key by which IoC resolves it is Manager::class

  3. Similar to 2, except you are instantiating the Manager class yourself. If the constructor requires any further DI, you will have to resolve it yourself,

Regarding, error with Facade, show some more code and error backtrace.

09 Aug
2 years ago

d3xt3r left a reply on Push Notification To IOS And Android

Do I need to buy push notification service or can this be achieved through the laravel backend?

Push notifications involve a backend which can deliver the notifications and a frontend which is configured to receive one. If you have taken care of later, former is a just a matter of making an http request. No special package required ...

d3xt3r left a reply on Like Operator In Laravel Blade

What if k != update ???

d3xt3r left a reply on Eager Loading Many To Many Relationships But Limiting The Results

Definitely. However, i am AFK. This question has been answered several times on this forum... try searching ... common cases displaying top N comments per post ... Also would help if you try writing native sql for your use case ...

d3xt3r left a reply on Where Should Timezone Processing Be Done, On Server Or On Client?

Depends what it does. If just displaying time to client, client side is fine. If taking certain decision based on client timezone then server side ... remember client is free to modify its clock so you shouldnt rely heavily on it for critical decisions ...

d3xt3r left a reply on Eager Loading Many To Many Relationships But Limiting The Results

It is not possible with eager loading ... what you want needs a group by which isn't a part of relations ...

d3xt3r left a reply on Axios To Catch Custom Validation Rule Error Message?

You have marked toDate as sometimes. Validation will only trigger if present...

d3xt3r left a reply on Code Structure Behind Controller

Don't fry your brain over this .... If and only if, your functions (so called logic) will be re-used by from multiple locations, you can move it to services/facades or static util classes ...

Its perfectly OK to have a few helper functions within controllers, if they are only to be used by the controller in question ...

d3xt3r left a reply on Filtering Nested Collections

Try ... just a hunch ... as filtering is not in place ... (perhaps)

return $clients->each(function ($client) {
    $client->schedules = $client->schedules->filter(function ($schedule) {
        return $schedule->some_custom_attribute == 'something';
    });
});

or create an associative array for client id and filtered schedules ... and reference it later, just not in most laravel'ly way ...

$filtered_schedules = [];

return $clients->each(function ($client) {
    $filtered_schedules[$client->id] = $client->schedules->filter(function ($schedule) {
        return $schedule->some_custom_attribute == 'something';
    });
});

d3xt3r left a reply on How To Get Value Of Select Option

<select>
  <option value="1">Bar</option>
</select>

This is the only way, if you are not getting 1, there might be other field in your form with name=foo and value=bar messing your select option...

d3xt3r left a reply on Subdomain Map To Subdirectory Route In Existing Laravel Project?

Use proxy_pass to redirect forum.example.com/* to app.example.com/forum/$1 ...

d3xt3r left a reply on Filtering Nested Collections

I'm wondering if I can do this with just collection methods, as I'd rather not use db joins in this instance.

Think twice, with proper indexes database modification/query will be faster, rather than loading all the data and filtering them in PHP. Also, executing each() will lead to N+1 queries, which you definitely don't want.

d3xt3r left a reply on Execution Order In Controller's Constructor With Middleware (Laravel 5.4)

$this->middleware(MyStupidMiddleware::class);

It does not actually execute the middleware code but add it to the list to be executed later ...

20 May
2 years ago

d3xt3r left a reply on How To Get A Route From URI

If you already know the uri what do you need the route for ?

15 May
2 years ago

d3xt3r left a reply on Why Ajax Not Post Method Not Working

So there it is, the form is being posted. Now figure out why your server made the boo boo with 500 all over the place.

d3xt3r left a reply on Send Mail After Returning To A View With Data

The problem is the function dies after the return view so I never get to send the email.

Sure, it will. Thats the definition of it. Use queues.

d3xt3r left a reply on Why Ajax Not Post Method Not Working

Check the debug console of your browser for any javascript error.

d3xt3r left a reply on Migration Fails Due To Not Finding Class

Class 'AddTimestampsToTables' not found

You might have previously migrated something by this name. Check your database and clear all the previous migration if any.

11 May
2 years ago

d3xt3r left a reply on CSS Files Not Updating

How are you generating the CSS files ? Gulp ?? or plain vanilla css files?? If former, you will need to compile it.

https://laracasts.com/lessons/laravel-and-gulp

d3xt3r left a reply on How To Show The Latest Post

I am still not sure, what exactly does not work. Do you see any error? If yes, what is it?

30 Apr
2 years ago

d3xt3r left a reply on Managing Users Files

If authentication is involved, use storage as it cannot be directly accessed by web.

Edit: Also explore S3 and sorts.

d3xt3r left a reply on Cache::remember - Forever?

I remember there used to be a caching strategy for query builder. Is it no longer the case ?

24 Apr
2 years ago

d3xt3r left a reply on I Have Problems Updating A File Type Input That Sends An Image

Are you re-uploading the img while updating?

d3xt3r left a reply on PHP 7.1 "A Non-numeric Value Encountered" On DB::raw

http://php.net/manual/fr/migration71.other-changes.php

It may not be related to query.... can you show the exact error message and lines which fail ....

d3xt3r left a reply on Local Scope Pivot Table - L5.2

wherePivot() is a member of ManyToMany relationship and not general Query builder, hence scope would not work as expected in this case. It is building where query on column pivot

Create a new relationship unreadConversionsations()

public function unreadConversations() {
    return $this->belongsToMany('whatever')->wherePivot('whatever');
}

d3xt3r left a reply on I Have Problems Updating A File Type Input That Sends An Image

Move $articles->img_dest = $name within the if block.

d3xt3r left a reply on PHP 7.1 "A Non-numeric Value Encountered" On DB::raw

Not sure, why it would work on one version. The placement of " does not seem correct in first query... either escape the double quotes or use single quotes ....

10 Nov
2 years ago

d3xt3r left a reply on Retrieving Only Id Values From DB Table

Unable to understand sync() and then create() ? Sorry you may have to be verbose.

d3xt3r left a reply on Retrieving Only Id Values From DB Table

still not clear? What do you expect, when you dd() the array, this is what is expected. Its not associative ...

d3xt3r left a reply on Retrieving Only Id Values From DB Table

And this is the output that you get ???

d3xt3r left a reply on Retrieving Only Id Values From DB Table

Show the output and the one that you need ...

05 Nov
2 years ago

d3xt3r left a reply on When / How Do Expired Cache Items Get Deleted

Most cache are LRU based. Items get deleted(evicted) as an when required, as an example, to free memory for new items. I don't think Laravel's disk(file) based cache has a eviction policy.

If using any other driver (apc/memcached/redis) they will have a built in eviction system, so you need not worry. For disk based cache, you can rely on commands/packages etc...

04 Nov
2 years ago

d3xt3r left a reply on Extending Eloquent's Builder To Eager Load Collections W/ Limits

Eager loaded relationships does not care about groups, it all boils down to ` Select ... from ... where id in (...)'. So its next to impossible to achieve this using built in eager loading.

17 Oct
2 years ago

d3xt3r left a reply on "weighted" Newsfeed

Fairly trivial... Include a signed integer field to store the 'weight' value

I didn't realise you were just looking for this. I thought,, it was more about how you calculate the weights

d3xt3r left a reply on "weighted" Newsfeed

This isn't trivial. There are 100s and 1000s of variables that goes into weight calculation, including but not limited to other user's interaction with certain feed. Plus, the weight calculated for a certain event will be different for you and me.

Start by studying the variables that define your event.

d3xt3r left a reply on Request Class Not Returning Validation Errors

double check your routes definition ...

03 Oct
2 years ago

d3xt3r left a reply on Htmlentities() Expects Parameter 1 To Be String, Array Given - Laravel Name Array Inputs

{!! Form::text('name[]', null, ['class' => 'form-control eighty-percent']) !!}

This is what i am meant, you will have to treat arrays differently. https://github.com/LaravelCollective/html/issues/122

d3xt3r left a reply on Htmlentities() Expects Parameter 1 To Be String, Array Given - Laravel Name Array Inputs

Check or show your view C:\xampp\htdocs\projectbuilder\resources\views\invoices\create.blade.php, If passing an array, treat them as as array in your view.

d3xt3r left a reply on [5.3] Multi Auth Configuration Problem: Guards Use Same Session

Yes, it would as it shares the same cookie and hence session. Guards are not meant for different sessions, but different authentication logic. The hack wont be trivial and it would require manipulating cookies and session.

d3xt3r left a reply on Remembe Me Is Not Working For Me

But after logout I can't see checkbox checked and username password filled automatically.

This is not what is expected of this feature. Its meant for signing in automatically when session expires., so that on session expiry user is not logged out.

d3xt3r left a reply on Use Custom Helper Functions For +readability

Just an opinion, adding more and more functions to global namespace, makes me uncomfortable. What if (less probable) but if PHP introduces a function by same name.

Not against helper functions, but prefer name-spacing them by making them static functions of a helper class.

02 Oct
2 years ago

d3xt3r left a reply on Service Providers???? When Where Why?

what service providers are supposed to do besides registering things

Exactly that., register the services in a sense that they can be Plugged and Played...

even then you can still use classes by creating static functions etc

Well of-course, if the classes are tightly coupled with your app, (no abstraction, no interface), you don't need the Service Providers ...

Has anyone come across a nice short, good and complete blog or something that explains real life examples of when they can be used?

Well, to me they are a way to interact/talk with/to the IoC, so that's where i would start. https://laracasts.com/search?q=ioc&q-where=lessons

d3xt3r left a reply on Use Custom Helper Functions For +readability

Ouch.... :)

Well, rightly posted under TIPS. Fell free to use it or let it go ...