mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
Fix #379 Error after /setup: business.js missing but required?
This commit is contained in:
parent
c16f74d9a2
commit
7db4fd8cd0
@ -147,17 +147,21 @@ class PaymentLibrariesSeeder extends Seeder
|
||||
'Photo',
|
||||
];
|
||||
|
||||
foreach ($designs as $design) {
|
||||
for ($i=0; $i<count($designs); $i++) {
|
||||
$design = $designs[$i];
|
||||
$fileName = storage_path() . '/templates/' . strtolower($design) . '.js';
|
||||
$pdfmake = file_get_contents($fileName);
|
||||
if ($pdfmake) {
|
||||
$record = InvoiceDesign::whereName($design)->first();
|
||||
if (!$record) {
|
||||
$record = new InvoiceDesign;
|
||||
$record->name = $design;
|
||||
if (file_exists($fileName)) {
|
||||
$pdfmake = file_get_contents($fileName);
|
||||
if ($pdfmake) {
|
||||
$record = InvoiceDesign::whereName($design)->first();
|
||||
if (!$record) {
|
||||
$record = new InvoiceDesign;
|
||||
$record->id = $i + 1;
|
||||
$record->name = $design;
|
||||
}
|
||||
$record->pdfmake = $pdfmake;
|
||||
$record->save();
|
||||
}
|
||||
$record->pdfmake = $pdfmake;
|
||||
$record->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user