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:
parent
0785e76df6
commit
c763d749c9
7 changed files with 103 additions and 2 deletions
23
app/Http/Controllers/AppealMailController.php
Normal file
23
app/Http/Controllers/AppealMailController.php
Normal 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');
|
||||
}
|
||||
}
|
|
@ -75,6 +75,13 @@ class FrontIndexController extends Controller
|
|||
]);
|
||||
}
|
||||
|
||||
public function appeals()
|
||||
{
|
||||
return view('front.appeals', [
|
||||
'title' => "LOCATION APPEALS",
|
||||
]);
|
||||
}
|
||||
|
||||
public function location(string $uuid = "1")
|
||||
{
|
||||
$location = Location::where("uuid", $uuid)->first();
|
||||
|
|
55
app/Mail/LocationAppeal.php
Normal file
55
app/Mail/LocationAppeal.php
Normal 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 [];
|
||||
}
|
||||
}
|
|
@ -37,9 +37,8 @@ section[role="listings"] div[role="paginate"] span {
|
|||
|
||||
a.list-link {
|
||||
display: grid;
|
||||
grid-template-columns: 70px 80% 80px 80px;
|
||||
grid-template-columns: 70px 1fr 80px 80px;
|
||||
gap: 10px;
|
||||
width: 90%;
|
||||
height: 45px;
|
||||
padding-bottom: 20px;
|
||||
cursor: pointer;
|
||||
|
|
3
resources/views/email/appeal.blade.php
Normal file
3
resources/views/email/appeal.blade.php
Normal file
|
@ -0,0 +1,3 @@
|
|||
<div>
|
||||
A quick test to see if it works.
|
||||
</div>
|
11
resources/views/front/appeals.blade.php
Normal file
11
resources/views/front/appeals.blade.php
Normal 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
|
|
@ -6,6 +6,7 @@ use App\Http\Controllers\AuthController;
|
|||
use App\Http\Controllers\DenController;
|
||||
use App\Http\Controllers\LocationController;
|
||||
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("/about", [FrontIndexController::class, 'about']);
|
||||
Route::get("/location/{uuid}", [FrontIndexController::class, 'location']);
|
||||
Route::get("/appeals", [FrontIndexController::class, 'appeals']);
|
||||
Route::post("/search", [FrontIndexController::class, 'indexSearch']);
|
||||
Route::get("/appeal", [AppealMailController::class, 'sendAppeal']);
|
||||
|
||||
//exports
|
||||
Route::get("/exports", [ExportController::class, 'exportIndex']);
|
||||
|
|
Loading…
Reference in a new issue