0 Best Reply Awards

  • Member Since 1 Year Ago
  • 0 Lessons Completed
  • 0 Favorites

10th August, 2018

pdc started a new conversation How Do I Send An E-mail Through SMTP • 2 months ago

I'm trying to send mails through the mailhub of my Internet Service Provider (Telenet). Previously, I've done the same using the simple-smtp linux package.

The configuration was as follows:

[email protected] mailhub=smtp.telenet.be:587 rewriteDomain=example.com hostname=example.com UseTLS=YES UseSTARTTLS=Yes [email protected] AuthPass=your_password AuthMethod=LOGIN FromLineOverride=YES

To make this successful, I also had to set up following reverse aliases in sSMTP. For each Linux user who wants to send emails - let's say www-data since that's the user that runs the webserver.

root:[email protected]:smtp.telenet.be:587 pi:[email protected]:smtp.telenet.be:587 no-reply:[email protected]:smtp.telenet.be:587 www-data:[email protected]:smtp.telenet.be:587

I've already set up my environment file with the credentials to connect to the Telenet mailhub. This works as expected. However, PHP complains about missing reverse aliases.

Expected response code 250 but got code "550", with message "550 5.1.0 [email protected] is not an alias of [email protected]"

Where can I set up these reverse aliases to allow the www-data user to send emails on behalf of [email protected]

16th January, 2018

pdc started a new conversation Laravel Localization For Long Strings • 8 months ago

I have a Laravel website with views containing long, static strings. From the documentation (https://laravel.com/docs/5.2/localization) I understand you can use App::setLocale($locale) and App::getLocale() to change the locale. However, since my views contain long strings (mainly parameterless), I don't see how it would be handy to paste all these texts into /resources/lang/{locale}/messages.php-file. I assume this would get very confusing very fast. How do you deal with this?

Site I want to localize: https://arromanchesbnb.pieterjan.pro/

25th November, 2017

pdc left a reply on Sync Pivot-table With Additional Columns • 10 months ago

Well never mind. I've arrived on this page: https://laracasts.com/discuss/channels/laravel/sync-with-array-data-and-pivot And I was able to implement it successfully.

pdc started a new conversation Sync Pivot-table With Additional Columns • 10 months ago

I'm trying to update additional columns on a pivot-table. I have a model "Person" and "Artist". There's a many-to-many relationship between them. The pivot-table contains a column named "active". This is the one i'm trying to set, and determines whether or not a person is still in the band.

class Artist extends Model { public function members() { return $this->belongsToMany('App\Entities\Person')->withPivot('active'); } } class Person extends Model { public function artist() { return $this->belongsToMany('App\Entities\Artist')->withPivot('active'); } }

Storing the members and quit_members works like a charm

$artist->members()->attach($artistData->members, array('active' => TRUE)); $artist->members()->attach($artistData->past_members, array('active' => FALSE));

To update the members I'd expected below code to work:

// One would expect this to work (sync m2m, for members set active=TRUE, for past_members set active=FALSE) // first detach existing pivots which are not in the members-list, and attach (if necessary) the remaining members. set all "actives" to TRUE $artist->members()->sync($artistData->members, array('active' => TRUE)); // keep the above set pivots, and attach (if necessary) the past_members, setting all "actives" to FALSE $artist->members()->syncWithoutDetaching($artistData->past_members, array('active' => FALSE));

But somehow this code still detaches the existing entities. How can I deal with this. I don't want to add another pivot-table for this so that's why i use the active-column.

GitHub reference (line 45) https://github.com/PieterjanDeClippel/LyricDB/blob/master/app/Services/ArtistService.php

Edit Your Profile

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