wip
This commit is contained in:
1 parent
ae6bb58972
commit
054654fb9c
18 files changed
+1325
-85
No files matched your search
@@ -2,10 +2,28 @@
|
||||
|
||||
namespace App\Actions\Generate\Pdf;
|
||||
|
||||
use App\Actions\Generate\Pdf;
|
||||
use App\Models\ProjektPlatzhalter;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class Platzhalter
|
||||
{
|
||||
public static function replace($platzhalter, $standardtext)
|
||||
{
|
||||
return str_replace(array_keys($platzhalter), array_values($platzhalter), $standardtext);
|
||||
}
|
||||
|
||||
public static function load($projekte_id)
|
||||
{
|
||||
$platzhalter = ProjektPlatzhalter::where('projekte_id', $projekte_id)->pluck('platzhaltertext', 'platzhalter')->toArray();
|
||||
$platzhalter['###INTERNER_NAME###'] = Pdf::$projekt->interner_name;
|
||||
$platzhalter['###OFFIZIELLER_NAME###'] = Pdf::$projekt->offizieller_name;
|
||||
$platzhalter['###ORT###'] = Pdf::$projekt->ort;
|
||||
$platzhalter['###FIRMA###'] = Pdf::$gutachter->company;
|
||||
|
||||
$dt = Carbon::create(Pdf::$projekt->erstellung);
|
||||
$platzhalter['###DATUM###'] = $dt->isoFormat('D. MMMM YYYY');
|
||||
|
||||
return $platzhalter;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user