add keys
This commit is contained in:
parent
94d6cbbca7
commit
15d5dfa593
|
|
@ -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',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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'],
|
||||||
|
|
@ -32,6 +34,17 @@ public function create($data)
|
||||||
return true ;
|
return true ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parent::create([
|
||||||
|
'name' => $data['name'],
|
||||||
|
'phone' => $data['phone'],
|
||||||
|
'email' => $data['email'],
|
||||||
|
'message' => $data['message'],
|
||||||
|
|
||||||
|
]);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function update($id ,$data)
|
public function update($id ,$data)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user