mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-12-24 08:44:02 +00:00
Update ContactController
This commit is contained in:
parent
1bb3e0344b
commit
8430a8419a
1 changed files with 4 additions and 0 deletions
|
@ -5,11 +5,13 @@ namespace App\Http\Controllers;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Auth;
|
use Auth;
|
||||||
use App\Contact;
|
use App\Contact;
|
||||||
|
use App\Jobs\ContactPipeline\ContactPipeline;
|
||||||
|
|
||||||
class ContactController extends Controller
|
class ContactController extends Controller
|
||||||
{
|
{
|
||||||
public function show(Request $request)
|
public function show(Request $request)
|
||||||
{
|
{
|
||||||
|
abort_if(!config('instance.email') && !config('instance.contact.enabled'), 404);
|
||||||
return view('site.contact');
|
return view('site.contact');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,6 +44,8 @@ class ContactController extends Controller
|
||||||
$contact->message = $message;
|
$contact->message = $message;
|
||||||
$contact->save();
|
$contact->save();
|
||||||
|
|
||||||
|
ContactPipeline::dispatchNow($contact);
|
||||||
|
|
||||||
return redirect()->back()->with('status', 'Success - Your message has been sent to admins.');
|
return redirect()->back()->with('status', 'Success - Your message has been sent to admins.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue