has('entity') && request()->has('entity_id')) { $class = 'App\Models\\'.ucfirst(request()->input('entity')); $entity_obj = $class::whereId(request()->input('entity_id'))->company()->first(); } $subject = request()->input('subject') ?: ''; $body = request()->input('body') ?: ''; $converter = new CommonMarkConverter([ 'html_input' => 'strip', 'allow_unsafe_links' => false, ]); $data = [ 'subject' => request()->input('subject'), 'body' => $converter->convertToHtml($body), ]; return response()->json($data, 200); } }