Messaging infrastructure

Put together a quick test to get internal messaging working for appeals
and joining current sources requests. Now that it works, forms that will
leverage messaging will be created.
This commit is contained in:
ro 2024-02-02 12:16:11 -06:00
parent 0785e76df6
commit c763d749c9
7 changed files with 103 additions and 2 deletions

View file

@ -0,0 +1,23 @@
<?php
namespace App\Http\Controllers;
use App\Mail\LocationAppeal;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Mail;
class AppealMailController extends Controller
{
/**
* Send appeal request
*/
public function sendAppeal(Request $request): RedirectResponse
{
//$order = Order::findOrFail($request->order_id);
Mail::to('ro@h-i.works')->send(new LocationAppeal());
return redirect('/appeals');
}
}

View file

@ -75,6 +75,13 @@ class FrontIndexController extends Controller
]); ]);
} }
public function appeals()
{
return view('front.appeals', [
'title' => "LOCATION APPEALS",
]);
}
public function location(string $uuid = "1") public function location(string $uuid = "1")
{ {
$location = Location::where("uuid", $uuid)->first(); $location = Location::where("uuid", $uuid)->first();

View file

@ -0,0 +1,55 @@
<?php
namespace App\Mail;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Mail\Mailables\Address;
use Illuminate\Queue\SerializesModels;
class LocationAppeal extends Mailable
{
use Queueable;
use SerializesModels;
/**
* Create a new message instance.
*/
public function __construct()
{
//
}
/**
* Get the message envelope.
*/
public function envelope(): Envelope
{
return new Envelope(
from: new Address('thebadspace@h-i.works', 'TBS Appeal Request'),
subject: 'Location Appeal',
);
}
/**
* Get the message content definition.
*/
public function content(): Content
{
return new Content(
view: 'email.appeal',
);
}
/**
* Get the attachments for the message.
*
* @return array<int, \Illuminate\Mail\Mailables\Attachment>
*/
public function attachments(): array
{
return [];
}
}

View file

@ -37,9 +37,8 @@ section[role="listings"] div[role="paginate"] span {
a.list-link { a.list-link {
display: grid; display: grid;
grid-template-columns: 70px 80% 80px 80px; grid-template-columns: 70px 1fr 80px 80px;
gap: 10px; gap: 10px;
width: 90%;
height: 45px; height: 45px;
padding-bottom: 20px; padding-bottom: 20px;
cursor: pointer; cursor: pointer;

View file

@ -0,0 +1,3 @@
<div>
A quick test to see if it works.
</div>

View file

@ -0,0 +1,11 @@
@extends('frame')
@section('title', 'The Bad Space|Exports')
@section('main-content')
@parent
<section>
<article>
<h2>Appeal Process</h2>
<a href="/appeal">Send Appeal Request</a>
</article>
</section>
@endsection

View file

@ -6,6 +6,7 @@ use App\Http\Controllers\AuthController;
use App\Http\Controllers\DenController; use App\Http\Controllers\DenController;
use App\Http\Controllers\LocationController; use App\Http\Controllers\LocationController;
use App\Http\Controllers\ExportController; use App\Http\Controllers\ExportController;
use App\Http\Controllers\AppealMailController;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
@ -23,7 +24,9 @@ Route::get("/", [FrontIndexController::class, 'start']);
Route::get("/listings/{pageNum}", [FrontIndexController::class, 'listings']); Route::get("/listings/{pageNum}", [FrontIndexController::class, 'listings']);
Route::get("/about", [FrontIndexController::class, 'about']); Route::get("/about", [FrontIndexController::class, 'about']);
Route::get("/location/{uuid}", [FrontIndexController::class, 'location']); Route::get("/location/{uuid}", [FrontIndexController::class, 'location']);
Route::get("/appeals", [FrontIndexController::class, 'appeals']);
Route::post("/search", [FrontIndexController::class, 'indexSearch']); Route::post("/search", [FrontIndexController::class, 'indexSearch']);
Route::get("/appeal", [AppealMailController::class, 'sendAppeal']);
//exports //exports
Route::get("/exports", [ExportController::class, 'exportIndex']); Route::get("/exports", [ExportController::class, 'exportIndex']);