add_Exception_and_config
|
|
@ -11,7 +11,7 @@ public function rules(): array
|
|||
{
|
||||
return [
|
||||
'key' => 'required|string',
|
||||
'value' => 'required|string',
|
||||
'value' => 'required',
|
||||
'type' => 'nullable|string|in:setting,about_us,contact_us,home',
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ public function rules(): array
|
|||
{
|
||||
return [
|
||||
'key' => 'nullable|string',
|
||||
'value' => 'nullable|string',
|
||||
'value' => 'nullable',
|
||||
'type' => 'nullable|string|in:setting,about_us,contact_us,home',
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ public function toArray(Request $request): array
|
|||
'id' => $this->id,
|
||||
'name' => $this->name,
|
||||
'description' => $this->description,
|
||||
'image' => $this->image ? $app_base_url . $this->image : null,
|
||||
'image' => $this->image ,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public function toArray(Request $request): array
|
|||
'project_id' => $this->project_id,
|
||||
'type' => $this->type,
|
||||
'is_active' => $this->is_active,
|
||||
'image' => $this->image ? $app_base_url . $this->image : null,
|
||||
'image' => $this->image,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,12 +15,11 @@ class ProjectResource extends JsonResource
|
|||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
$app_base_url = Config::get('appSetting.app_base_url');
|
||||
return [
|
||||
"id"=> $this->id,
|
||||
'title' => $this->title,
|
||||
'description' => $this->description,
|
||||
'logo' => $this->logo ? $app_base_url . $this->logo : null,
|
||||
'logo' => $this->logo ,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public function toArray(Request $request): array
|
|||
'phone' => $this->phone,
|
||||
'email' => $this->email,
|
||||
'message' => $this->message,
|
||||
'attachment' => $this->attachment ? $app_base_url . $this->attachment : null,
|
||||
'attachment' => $this->attachment ,
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ public function toArray(Request $request): array
|
|||
"id"=> $this->id,
|
||||
'title' => $this->title,
|
||||
'description' => $this->description,
|
||||
'image' => $this->image ? $app_base_url . $this->image : null,
|
||||
'image' => $this->image ,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,11 @@ public function boot(): void
|
|||
->prefix('api')
|
||||
->group(base_path('routes/api.php'));
|
||||
|
||||
Route::middleware('website')
|
||||
->group(base_path('routes/website.php'));
|
||||
|
||||
Route::middleware('web')
|
||||
->prefix('web')
|
||||
->group(base_path('routes/web.php'));
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,9 +33,9 @@ public function create($data)
|
|||
public function update($id ,$data)
|
||||
{
|
||||
if (isset($data['image']) && !empty($data['image'])) {
|
||||
$updated_image = ImageService::update_image($data['image'], 'developer');
|
||||
parent::update($id,array_merge($data, ['image' => $updated_image]));
|
||||
|
||||
$Oldimage = Developer::find($id)->image ;
|
||||
$updated_image = ImageService::update_image($data['image'],$Oldimage, 'developer');
|
||||
$data['image'] = $updated_image;
|
||||
}
|
||||
|
||||
parent::update($id,$data);
|
||||
|
|
|
|||
|
|
@ -9,24 +9,25 @@
|
|||
|
||||
class ImageService
|
||||
{
|
||||
public static function upload_image(UploadedFile $new_image, $folder = '')
|
||||
public static function upload_image(UploadedFile $new_image, $upload_location = '')
|
||||
{
|
||||
$upload_location = Config::get('appSetting.upload_location', 'images');
|
||||
$upload_folder = Config::get('appSetting.upload_folder');
|
||||
|
||||
$image_path_without_public = $upload_location . $folder . '/';
|
||||
$image_path = public_path() . $upload_location . $folder . '/';
|
||||
$image_name = $folder . '_' . Str::uuid() . '.' . $new_image->getClientOriginalExtension();
|
||||
$image_path_without_public = $upload_folder . $upload_location . '/';
|
||||
$image_path = public_path() . $upload_folder . $upload_location . '/';
|
||||
$image_name = $upload_location . '_' . Str::uuid() . '.' . $new_image->getClientOriginalExtension();
|
||||
$new_image->move($image_path, $image_name);
|
||||
|
||||
return $image_path_without_public . $image_name;
|
||||
}
|
||||
|
||||
public static function update_image(UploadedFile $new_image, $old_image_name, $folder = '')
|
||||
public static function update_image(UploadedFile $new_image, $old_image_name, $upload_location = '')
|
||||
{
|
||||
$upload_location = Config::get('appSetting.upload_location', 'images');
|
||||
$new_image_path_without_public = $upload_location . $folder . '/';
|
||||
$new_image_path = public_path() . $upload_location . $folder . '/';
|
||||
$new_image_name = $folder . '_' . Str::uuid() . '.' . $new_image->getClientOriginalExtension();
|
||||
$upload_folder = Config::get('appSetting.upload_folder');
|
||||
|
||||
$new_image_path_without_public = $upload_folder . $upload_location . '/';
|
||||
$new_image_path = public_path() . $upload_folder . $upload_location . '/';
|
||||
$new_image_name = $upload_location . '_' . Str::uuid() . '.' . $new_image->getClientOriginalExtension();
|
||||
$new_image->move($new_image_path, $new_image_name);
|
||||
try {
|
||||
unlink(public_path() . $old_image_name);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
use App\Models\Key;
|
||||
use App\Models\Service;
|
||||
use App\Services\Base\BaseService;
|
||||
use GuzzleHttp\Psr7\UploadedFile;
|
||||
use Illuminate\Http\Client\Request;
|
||||
|
||||
class KeyService extends BaseService
|
||||
|
|
@ -34,19 +35,32 @@ public function getallWithfillter($request)
|
|||
|
||||
public function create($data)
|
||||
{
|
||||
if (gettype($data['value']) === "object") {
|
||||
$image = ImageService::upload_image($data['value'], "key");
|
||||
|
||||
parent::create([
|
||||
'key' => $data['key'],
|
||||
'value' => $image ,
|
||||
'type' => $data['type'],
|
||||
]);
|
||||
} else {
|
||||
parent::create([
|
||||
'key' => $data['key'],
|
||||
'value' => $data['value'],
|
||||
'type' => $data['type']
|
||||
]);
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function update($id, $data)
|
||||
{
|
||||
if (gettype($data['value']) === "object") {
|
||||
$Oldimage = Key::find($id)->value;
|
||||
$updated_image = ImageService::update_image($data['value'], $Oldimage, 'key');
|
||||
$data['value'] = $updated_image;
|
||||
}
|
||||
|
||||
parent::update($id, $data);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,9 +44,11 @@ public function create($data)
|
|||
public function update($id ,$data)
|
||||
{
|
||||
if (isset($data['image']) && !empty($data['image'])) {
|
||||
$updated_image = ImageService::update_image($data['image'], 'ProjectImage');
|
||||
parent::update($id,array_merge($data, ['image' => $updated_image]));
|
||||
$Oldimage = ProjectImage::find($id)->image ;
|
||||
$updated_image = ImageService::update_image($data['image'],$Oldimage, 'ProjectImage');
|
||||
$data['image'] = $updated_image;
|
||||
}
|
||||
|
||||
parent::update($id,$data);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,8 +38,9 @@ public function create($data)
|
|||
public function update($id ,$data)
|
||||
{
|
||||
if (isset($data['logo']) && !empty($data['logo'])) {
|
||||
$updated_logo = ImageService::update_image($data['logo'], 'Project');
|
||||
parent::update($id,array_merge($data, ['logo' => $updated_logo]));
|
||||
$Oldlogo = Project::find($id)->logo ;
|
||||
$updated_logo = ImageService::update_image($data['logo'],$Oldlogo, 'Project');
|
||||
$data['logo'] = $updated_logo;
|
||||
}
|
||||
|
||||
parent::update($id,$data);
|
||||
|
|
|
|||
|
|
@ -31,8 +31,9 @@ public function create($data)
|
|||
public function update($id ,$data)
|
||||
{
|
||||
if (isset($data['image']) && !empty($data['image'])) {
|
||||
$updated_image = ImageService::update_image($data['image'], 'contactUs');
|
||||
parent::update($id,array_merge($data, ['image' => $updated_image]));
|
||||
$Oldimage = Service::find($id)->image ;
|
||||
$updated_image = ImageService::update_image($data['image'],$Oldimage, 'service');
|
||||
$data['image'] = $updated_image;
|
||||
}
|
||||
|
||||
parent::update($id,$data);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
return [
|
||||
'upload_location' => '/assets/',
|
||||
'upload_folder' => '/assets/',
|
||||
'app_base_url' => 'http://127.0.0.1:8000',
|
||||
];
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
|
@ -1,3 +0,0 @@
|
|||
# https://www.robotstxt.org/robotstxt.html
|
||||
User-agent: *
|
||||
Disallow:
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
# https://www.robotstxt.org/robotstxt.html
|
||||
User-agent: *
|
||||
Disallow:
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
# https://www.robotstxt.org/robotstxt.html
|
||||
User-agent: *
|
||||
Disallow:
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
# https://www.robotstxt.org/robotstxt.html
|
||||
User-agent: *
|
||||
Disallow:
|
||||
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 5.5 KiB |
|
After Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
BIN
public/assets/key/key_a0d18f4b-550e-41d8-bfce-6e09b816c4b4.jpeg
Normal file
|
After Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
After Width: | Height: | Size: 5.5 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
|
@ -1,3 +0,0 @@
|
|||
# https://www.robotstxt.org/robotstxt.html
|
||||
User-agent: *
|
||||
Disallow:
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
# https://www.robotstxt.org/robotstxt.html
|
||||
User-agent: *
|
||||
Disallow:
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
# https://www.robotstxt.org/robotstxt.html
|
||||
User-agent: *
|
||||
Disallow:
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
# https://www.robotstxt.org/robotstxt.html
|
||||
User-agent: *
|
||||
Disallow:
|
||||
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
19
routes/website.php
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<?php
|
||||
|
||||
use App\Http\Controllers\Dashboard\QuotationController;
|
||||
use App\Http\Controllers\website\ContactUsController;
|
||||
use App\Http\Controllers\website\DeveloperController;
|
||||
use App\Http\Controllers\website\KeyController;
|
||||
use App\Http\Controllers\website\ServiceController;
|
||||
use App\Http\Controllers\website\ProjectController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
|
||||
Route::get('/project', [ProjectController::class, 'index']);
|
||||
Route::get('/service', [ServiceController::class, 'index']);
|
||||
Route::get('/developer', [DeveloperController::class, 'index']);
|
||||
Route::get('/contact_us', [ContactUsController::class, 'index']);
|
||||
Route::get('/quotation', [QuotationController::class, 'index']);
|
||||
Route::get('/key', [KeyController::class, 'index']);
|
||||
|
||||
|
||||