add keys
This commit is contained in:
parent
94d6cbbca7
commit
15d5dfa593
|
|
@ -14,7 +14,7 @@ public function rules(): array
|
|||
'phone' => 'required|numeric',
|
||||
'email' => 'required|email',
|
||||
'message' => 'required|string',
|
||||
'attachment' => 'required|file|mimes:pdf,doc,docx,txt',
|
||||
'attachment' => 'nullable|file',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,14 +19,27 @@ public function __construct()
|
|||
|
||||
public function create($data)
|
||||
{
|
||||
$attachment = ImageService::upload_image($data['attachment'], "Quotation");
|
||||
|
||||
if (isset($data['attachment']) && !empty($data['attachment'])) {
|
||||
|
||||
$attachment = ImageService::upload_image($data['attachment'], "Quotation");
|
||||
parent::create([
|
||||
'name' => $data['name'],
|
||||
'phone' => $data['phone'],
|
||||
'email' => $data['email'],
|
||||
'message' => $data['message'],
|
||||
'attachment' => $attachment
|
||||
]);
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
parent::create([
|
||||
'name' => $data['name'],
|
||||
'phone' => $data['phone'],
|
||||
'email' => $data['email'],
|
||||
'message' => $data['message'],
|
||||
'attachment' => $attachment
|
||||
|
||||
]);
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ public function up(): void
|
|||
$table->string('phone');
|
||||
$table->string('email');
|
||||
$table->text('message');
|
||||
$table->string('attachment');
|
||||
$table->string('attachment')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,8 +20,13 @@ public function run(): void
|
|||
'value' => 'Home page description',
|
||||
'type' => 'home',
|
||||
],
|
||||
// [
|
||||
// 'key' => 'home_main_image',
|
||||
// 'value' => '/',
|
||||
// 'type' => 'home',
|
||||
// ],
|
||||
[
|
||||
'key' => 'home_main_image',
|
||||
'key' => 'portfolio',
|
||||
'value' => '/',
|
||||
'type' => 'home',
|
||||
],
|
||||
|
|
@ -45,6 +50,21 @@ public function run(): void
|
|||
'value' => "links",
|
||||
'type' => 'setting',
|
||||
],
|
||||
[
|
||||
'key' => 'links',
|
||||
'value' => "links",
|
||||
'type' => 'setting',
|
||||
],
|
||||
[
|
||||
'key' => 'facebook',
|
||||
'value' => "facebook",
|
||||
'type' => 'setting',
|
||||
],
|
||||
[
|
||||
'key' => 'linkedin',
|
||||
'value' => "linkedin",
|
||||
'type' => 'setting',
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($keys as $key) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user