Hi, thank you very much for your support. I have this in my deploy script:
cd /home/forge/app.austrianweddingaward.at
git pull origin master
composer install --no-interaction --prefer-dist --optimize-autoloader
( flock -w 10 9 || exit 1
echo 'Restarting FPM...'; sudo -S service php7.4-fpm reload ) 9>/tmp/fpmlock
if [ -f artisan ]; then
php artisan migrate --force
fi
This is my function
public function rejectProject(Request $data) {
$id = $data->id;
$project = Project::find($id);
$project->stat = '3';
$project->save();
//get user email
$project = Project::where('id', $id)->first();
$user_id = $project->user_id;
$user = User::where('id', $user_id)->first();
//Add to table RejectingProject - this is what I have add to the function
DB::table('rejects')->insert(
array(
'user_id' => $user_id,
'project_id' => $id,
'projectname' => $project->name,
'text' => $data->emailBody
)
);
//but it is not adding to the rejects table. I have also add app\Reject in the beginning of the script.
// Send Email
Mail::to($user->email)->send(new RejectingProject($data->emailBody, $project->name, $user->vorname.' '.$user->name));
Session::flash('alert-success','Das Projekt wurde erfolgreich zurückgewiesen.');
return response()->json(array('msg'=> 'Success'), 200);
}
This is what I have add to the code, but it is not putting anything into the database. The idea is - instead of only sending Status E-Mail to the Customer, I will add the text of the E-Mail into a Table "Rejects" to show the text in the dashboard of the user:
//Add to table RejectingProject - this is what I have add to the function
DB::table('rejects')->insert(
array(
'user_id' => $user_id,
'project_id' => $id,
'projectname' => $project->name,
'text' => $data->emailBody
)
);
//but it is not adding to the rejects table. I have also add app\Reject in the beginning of the script.
Thank you for your help!
Stefan