This commit is contained in:
karimalden 2024-07-29 14:40:29 +03:00
parent 94d6cbbca7
commit 15d5dfa593
4 changed files with 38 additions and 5 deletions

View File

@ -14,7 +14,7 @@ public function rules(): array
'phone' => 'required|numeric', 'phone' => 'required|numeric',
'email' => 'required|email', 'email' => 'required|email',
'message' => 'required|string', 'message' => 'required|string',
'attachment' => 'required|file|mimes:pdf,doc,docx,txt', 'attachment' => 'nullable|file',
]; ];
} }
} }

View File

@ -19,8 +19,10 @@ public function __construct()
public function create($data) 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([ parent::create([
'name' => $data['name'], 'name' => $data['name'],
'phone' => $data['phone'], 'phone' => $data['phone'],
@ -29,6 +31,17 @@ public function create($data)
'attachment' => $attachment 'attachment' => $attachment
]); ]);
return true ;
}
parent::create([
'name' => $data['name'],
'phone' => $data['phone'],
'email' => $data['email'],
'message' => $data['message'],
]);
return true; return true;
} }

View File

@ -17,7 +17,7 @@ public function up(): void
$table->string('phone'); $table->string('phone');
$table->string('email'); $table->string('email');
$table->text('message'); $table->text('message');
$table->string('attachment'); $table->string('attachment')->nullable();
$table->timestamps(); $table->timestamps();
}); });
} }

View File

@ -20,8 +20,13 @@ public function run(): void
'value' => 'Home page description', 'value' => 'Home page description',
'type' => 'home', 'type' => 'home',
], ],
// [
// 'key' => 'home_main_image',
// 'value' => '/',
// 'type' => 'home',
// ],
[ [
'key' => 'home_main_image', 'key' => 'portfolio',
'value' => '/', 'value' => '/',
'type' => 'home', 'type' => 'home',
], ],
@ -45,6 +50,21 @@ public function run(): void
'value' => "links", 'value' => "links",
'type' => 'setting', 'type' => 'setting',
], ],
[
'key' => 'links',
'value' => "links",
'type' => 'setting',
],
[
'key' => 'facebook',
'value' => "facebook",
'type' => 'setting',
],
[
'key' => 'linkedin',
'value' => "linkedin",
'type' => 'setting',
],
]; ];
foreach ($keys as $key) { foreach ($keys as $key) {