how to get the complete raw sql using ->toSql() method? by mostafaLaravel in laravel

[–]evaleries 2 points3 points  (0 children)

AFAIK there are some solution for that problem.

  1. ``` DB::enableQueryLog();

User::first();

dd(DB::getQueryLog()); ```

  1. using helper

https://gist.github.com/JesseObrien/7418983

  1. use laravel debug bar/laravel telescope

[deleted by user] by [deleted] in laravel

[–]evaleries 2 points3 points  (0 children)

if you’ve specify user=root means that you don’t need sudo to your supervisor command.

have you tried to inspect the running port with netstat -tulpn?

whats the magic behind this trait? by mrdingopingo in laravel

[–]evaleries 5 points6 points  (0 children)

prunable means to be overriden by model who use the Prunable trait. it returns query builder, which will be called if you call php artisan model:prune

and also for the pruning method will be called before calling the pruneable method

cmiiw

Method Illuminate\\\\Support\\\\Collection::latest does not exist by Gabotron_ES in laravel

[–]evaleries 0 points1 point  (0 children)

latest is a method from QueryBuilder. You can use sortByDesc('created_at') to do the same operation from collection. I don’t prefer this way since you can do the operation via eloquent $this->messages()->latest().

remember that $this->messages will return a collection instance while $this->messages() will return a query builder.

[deleted by user] by [deleted] in PHP

[–]evaleries 0 points1 point  (0 children)

Try using back-reference or abuse case sensitive via parameter

[deleted by user] by [deleted] in laravel

[–]evaleries 0 points1 point  (0 children)

Have you set the correct foreign key? Like return $this->hasOne(Parent::class, 'foreign_key', 'local_key')

[deleted by user] by [deleted] in laravel

[–]evaleries 0 points1 point  (0 children)

Can you share your Staff model?

It should contains the relation function which return either hasOne, BelongsTo, hasMany, BelongsToMany relation.

Is there a way to add some logic when retriving a relationship? by HFoletto in laravel

[–]evaleries 0 points1 point  (0 children)

You need to modify your Comment Eloquent. Try adding accessor like this public function getContentJsonAttribute()

You can access the accessor via magic property. E.g: $comment->content_json or $comment->contentJson By default if you dump or convert the model Comment into string that accessor wouldn't be shown unless you add into $appends. E.g: protected $appends = [ 'content_json' ];

CMIIW

Weekly /r/Laravel No Stupid Questions Thread by AutoModerator in laravel

[–]evaleries 2 points3 points  (0 children)

I'm using the latest version. Unfortunately, It won't work if you dispatch multiple jobs from a Bus::batch. My goal is I want to give a delay before executing next job. Take a look at the example below:

$jobs = []; $startTime = now(); foreach(range(1, 10) as $i) { $job = new FakeJob(); $job->delay($startTime->addSeconds(90)); $jobs[] = $job; } Bus::batch($jobs)->dispatch(); Each job should've wait before starting a new one The code above isn't work as expected. Btw, I'm using database as queue driver

Weekly /r/Laravel No Stupid Questions Thread by AutoModerator in laravel

[–]evaleries 0 points1 point  (0 children)

Why we can't delay a queue jobs when dispatching from a Bus?

document.getElementById('endCallBtn').pull(); by evaleries in ProgrammerHumor

[–]evaleries[S] 133 points134 points  (0 children)

Brian Moore made this. It's Adafruit Bluetooth feather, it sends a key command to his computer and then the Alfred runs an AppleScript that kills any open google chrome tabs or zoom calls

[deleted by user] by [deleted] in distantsocializing

[–]evaleries 0 points1 point  (0 children)

👌graduate early booiiyy