Sunday, May 20, 2018

URL generation removes port - development

URL generation removes port

I was trying to send an email when I encountered this error. So what I did is I created an event and on it’s listeners I want to send an email that will validate it’s email address. Just to be sure that everything will be secure I tried using URL::signedRoute to create a URL wherein if the user would click on it, it will go to the address produced by URL::signedRoute. What I just notice is that on the url that it created, there was no port in it.

Heres my mailable class

<?php

namespace AppMail;

use AppUser;
use IlluminateBusQueueable;
use IlluminateMailMailable;
use IlluminateQueueSerializesModels;
use IlluminateContractsQueueShouldQueue;
use IlluminateSupportFacadesURL;

class AccountValidation extends Mailable
{
    use Queueable, SerializesModels;

    public $user,$link;

    public function __construct(User $user)
    {
        $this->user = $user;
        $this->link = URL::temporarySignedRoute(
            'activateaccount', now()->addHour(), ['email'=>$user->email,'answer'=>'1']
        );
    }

    public function build()
    {
        return $this->from('welly@wellington.com')->view('emails.accountvalidation');
    }
}

The address from web.php

Route::get('/activate/{email}/{answer}','MyController@activateaccount')->name('activateaccount')->middleware('signed');

Here’s the URL that it produced.

http://localhost/activate/ewan@yahoo.com/1?expires=1526801279&amp;signature=823cfaece0a5184db2ef7e79e3f4bc9e3b4cbf362b98884323b0fe2605886912

I want the URL to have port 8000 like http://localhost:8000. Thank you for helping and excuse my grammar.



from Laravel Questions and Answers https://laravelquestions.com/php/url-generation-removes-port/
via Lzo Media

1 comment:

  1. Casino-Reviews- "Great" - Jammy Hub
    Casino-Reviews- "Great" We are 경산 출장샵 happy to inform you that we have not seen any 춘천 출장마사지 Casinos-Reviews 안산 출장샵 Casino-Reviews- "Great" We are happy 인천광역 출장마사지 to inform you that we have not seen any 서귀포 출장샵 Casinos-Reviews- "Great"

    ReplyDelete