d3xt3r

Experience

146,230

346 Best Reply Awards

  • Member Since 2 Years Ago
  • 290 Lessons Completed
  • 0 Favorites

20th August, 2017

d3xt3r left a reply on How To Upgrade From 5.4 To 5.5? • 3 months ago

How can I upgrade laravel V 5.4 to 5.5?

Please wait till official documentations are in place ...

14th August, 2017

d3xt3r left a reply on Service Provider Register() And Provides() • 3 months ago

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 tab. When any such request is received by IoC, an instance of Manager class is instantiated. Using $app->make() allows for any further DI in the Managers 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 your selves. 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.

9th August, 2017

d3xt3r left a reply on Push Notification To IOS And Android • 4 months ago

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 • 4 months ago

What if k != update ???

d3xt3r left a reply on Eager Loading Many To Many Relationships But Limiting The Results • 4 months ago

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? • 4 months ago

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 • 4 months ago

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 Base Table Or View Not Found: 1051 Unknown Table After Php Artisan Migrate:refresh • 4 months ago

Short term solution: use drop if exists ...

d3xt3r left a reply on Axios To Catch Custom Validation Rule Error Message? • 4 months ago

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

d3xt3r left a reply on Code Structure Behind Controller • 4 months ago

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 • 4 months ago

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'; }); });

d3xt3r left a reply on How To Get Value Of Select Option • 4 months ago

<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 How To Get Value Of Select Option • 4 months ago

Ya, and I want a beer. HTML 101.

https://www.w3schools.com/tags/tag_select.asp

d3xt3r left a reply on Subdomain Map To Subdirectory Route In Existing Laravel Project? • 4 months ago

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

d3xt3r left a reply on Filtering Nested Collections • 4 months ago

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) • 4 months ago

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

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

20th May, 2017

d3xt3r left a reply on How To Get A Route From URI • 6 months ago

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

15th May, 2017

d3xt3r left a reply on Why Ajax Not Post Method Not Working • 6 months ago

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

d3xt3r left a reply on Send Mail After Returning To A View With Data • 6 months ago

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 • 6 months ago

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

d3xt3r left a reply on Using Route.php Code, If Button Is Clicked • 6 months ago

Heard of AJAX? If yes use it, if not try https://www.w3schools.com/xml/ajax_intro.asp

d3xt3r left a reply on Migration Fails Due To Not Finding Class • 6 months ago

Class 'AddTimestampsToTables' not found

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

11th May, 2017

d3xt3r left a reply on CSS Files Not Updating • 7 months ago

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 • 7 months ago

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

30th April, 2017

d3xt3r left a reply on Managing Users Files • 7 months ago

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

d3xt3r left a reply on Cache::remember - Forever? • 7 months ago

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

24th April, 2017

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

Are you re-uploading the img while updating?

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

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 • 7 months ago

wherePivot() is a member of ManyToMany relationship and not general Query builder, hence scope would not work as expected.

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 • 7 months ago

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 • 7 months ago

Not sure, why it would work on one version. The placement of " does not seem correct in first query...

10th November, 2016

d3xt3r left a reply on Retrieving Only Id Values From DB Table • 1 year ago

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 • 1 year ago

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

d3xt3r left a reply on Retrieving Only Id Values From DB Table • 1 year ago

And this is the output that you get ???

d3xt3r left a reply on Retrieving Only Id Values From DB Table • 1 year ago

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

5th November, 2016

d3xt3r left a reply on When / How Do Expired Cache Items Get Deleted • 1 year ago

Most cache are LRU based. They 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...

4th November, 2016

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

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.

17th October, 2016

d3xt3r left a reply on "weighted" Newsfeed • 1 year ago

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 • 1 year ago

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 • 1 year ago

double check your routes definition ...

3rd October, 2016

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

{!! 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 • 1 year ago

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 • 1 year ago

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 • 1 year ago

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 • 1 year ago

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.

2nd October, 2016

d3xt3r left a reply on Service Providers???? When Where Why? • 1 year ago

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 • 1 year ago

Ouch.... :)

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

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.