-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: upgraded to work with Laravel 10x
- Loading branch information
Showing
20 changed files
with
338 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
migrations/2024_01_30_164300_add_expires_at_column_to_personal_access_tokens_table.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('personal_access_tokens', function (Blueprint $table) { | ||
$table->timestamp('expires_at')->nullable()->after('last_used_at'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('personal_access_tokens', function (Blueprint $table) { | ||
$table->dropColumn('expires_at'); | ||
}); | ||
} | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
namespace Fleetbase\Mail; | ||
|
||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Mail\Mailable; | ||
use Illuminate\Mail\Mailables\Envelope; | ||
use Illuminate\Mail\Mailables\Content; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class TestMail extends Mailable | ||
{ | ||
use Queueable; | ||
use SerializesModels; | ||
|
||
/** | ||
* Get the message content definition. | ||
* | ||
* @return \Illuminate\Mail\Mailables\Envelope | ||
*/ | ||
public function envelope(): Envelope | ||
{ | ||
return new Envelope( | ||
subject: '🎉 Your Fleetbase Mail Configuration Works!', | ||
); | ||
} | ||
|
||
/** | ||
* Get the message content definition. | ||
* | ||
* @return \Illuminate\Mail\Mailables\Content | ||
*/ | ||
public function content(): Content | ||
{ | ||
return new Content( | ||
text: 'Hello! This is a test email from Fleetbase to confirm that your mail configuration works.', | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<?php | ||
|
||
namespace Fleetbase\Mail; | ||
|
||
use Fleetbase\Models\VerificationCode; | ||
use Illuminate\Mail\Mailable; | ||
use Illuminate\Mail\Mailables\Envelope; | ||
use Illuminate\Mail\Mailables\Content; | ||
use Illuminate\Queue\SerializesModels; | ||
// use Illuminate\Contracts\Queue\ShouldQueue; | ||
use Illuminate\Bus\Queueable; | ||
|
||
class VerificationMail extends Mailable | ||
{ | ||
use Queueable; | ||
use SerializesModels; | ||
|
||
/** | ||
* The verification code to email. | ||
* | ||
* @var \Fleetbase\Models\VerificationCode | ||
*/ | ||
private VerificationCode $verificationCode; | ||
|
||
/** | ||
* Custom content to render if supplied. | ||
* | ||
* @var string|null | ||
*/ | ||
private ?string $content; | ||
|
||
/** | ||
* Create a new message instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct(VerificationCode $verificationCode, ?string $content = null) | ||
{ | ||
$this->verificationCode = $verificationCode; | ||
$this->content = $content; | ||
} | ||
|
||
/** | ||
* Get the message content definition. | ||
* | ||
* @return \Illuminate\Mail\Mailables\Envelope | ||
*/ | ||
public function envelope(): Envelope | ||
{ | ||
return new Envelope( | ||
subject: $this->verificationCode->code . ' is your ' . config('app.name') . ' verification code', | ||
); | ||
} | ||
|
||
/** | ||
* Get the message content definition. | ||
* | ||
* @return \Illuminate\Mail\Mailables\Content | ||
*/ | ||
public function content(): Content | ||
{ | ||
return new Content( | ||
html: 'fleetbase::mail.verification', | ||
with: [ | ||
'appName' => config('app.name'), | ||
'currentHour' => now()->hour, | ||
'user' => $this->verificationCode->subject, | ||
'code' => $this->verificationCode->code, | ||
'content' => $this->content | ||
] | ||
); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.