Modify Laravel App PHP to Create New Field and Use it -- 2

Job ID: 35009592

Budget: $30 – $250 USD

I have a current app in laravel.
I need to dynamic (from database) choose a template now it is located in a file in env.
create field in database table companies (idtemplate) create file to make migrations "use Illuminate\Database\Migrations\Migration;"
maintain current logic and if new field idtemplate is not null then retrieves data from database.

sample code :
protected function createPDF($user, $company, $customer, $typeDocument, $resolution, $date, $time, $paymentForm, $request, $cufecude, $tipodoc = "INVOICE", $withHoldingTaxTotal = NULL, $notes = NULL, $healthfields)
{
$template_json = false;
set_time_limit(0);
if(isset($request->invoice_template))
if(!is_null($request->invoice_template) && ($request->invoice_template <> '')){
if(password_verify($company->identification_number, $request->template_token)){
$template_pdf = $request->invoice_template;
$template_json = true;
}
else
$template_pdf = env("GRAPHIC_REPRESENTATION_TEMPLATE", 2); *** this is where change must be done**
}
else
$template_pdf = env("GRAPHIC_REPRESENTATION_TEMPLATE", 2); *** this is where change must be done**
else
$template_pdf = env("GRAPHIC_REPRESENTATION_TEMPLATE", 2); *** this is where change must be done**
Related categories: PHP Software Architecture MySQL HTML Laravel