Create WeeklyReport mail
ADD
app/Mail/WeeklyReport.php
+<?php
+
+namespace App\Mail;
+
+use App\Space;
+use Illuminate\Bus\Queueable;
+use Illuminate\Mail\Mailable;
+use Illuminate\Queue\SerializesModels;
+use Illuminate\Contracts\Queue\ShouldQueue;
+
+class WeeklyReport extends Mailable {
+ use Queueable, SerializesModels;
+
+ protected $space;
+
+ public function __construct(Space $space) {
+ $this->space = $space;
+ }
+
+ public function build() {
+ return $this->view('emails.weekly_report')
+ ->with([
+ 'space' => $this->space
+ ]);
+ }
+}

ADD
resources/views/emails/weekly_report.blade.php
+Here's your weekly report for {{ $space->name }}.
+
+This week (WEEK_START - WEEK_END) you've
+* Spent CURRENCY SPENT_TOTAL_AMOUNT
+* Most of which you've spent on SPENT_MOST_TAG_NAME (CURRENCY SPENT_MOST_TAG_AMOUNT)
+
+If you don't want to receive a weekly report, head over to <a href="{{ config('app.url') . '/settings' }}">settings</a> and let us know.

Create WeeklyReport mail