示例#1
0
 public function send_contract_new_mod($forum_user_id, $contract_id)
 {
     $contract = SyndieContract::find($contract_id);
     $forum_user = ForumUserModel::find($forum_user_id);
     $from_name = config('aurora.syndie_contract_from_name');
     $from_address = config('aurora.syndie_contract_from_address');
     //Get user E-Mail
     Mail::send('emails.contract_new_mod', ['forum_user' => $forum_user, 'contract' => $contract], function ($m) use($forum_user, $contract, $from_name, $from_address) {
         $m->from($from_address, $from_name);
         $m->to($forum_user->user_email, $forum_user->username);
         $m->subject('Contract Update - ' . $contract->title);
     });
 }
 public function reject(Request $request, $contract)
 {
     //Check if player is contract mod
     if ($request->user()->can('syndie_contract_moderate')) {
         $SyndieContract = SyndieContract::find($contract);
         $SyndieContract->status = "mod-nok";
         $SyndieContract->save();
         $this->dispatch(new SendContractNotificationEmail($SyndieContract, 'reject'));
         Log::notice('perm.contracts.reject - Contract has been rejected', ['user_id' => $request->user()->user_id, 'contract_id' => $SyndieContract->contract_id]);
         return redirect()->route('syndie.contracts.show', ['contract' => $contract]);
     } else {
         abort(403, 'Unauthorized action.');
     }
 }