inital commit
This commit is contained in:
45
app/Models/CreditreportProvider.php
Normal file
45
app/Models/CreditreportProvider.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class CreditreportProvider extends BaseModel
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $fillable = ['company_type','link'];
|
||||
|
||||
public function getReportProviders()
|
||||
{
|
||||
return self::pluck('link','company_type');
|
||||
}
|
||||
public function deleteReportProvider($inputData)
|
||||
{
|
||||
$data = [];
|
||||
$provider = self:: where('company_type',$inputData['delete_source_type'])->first();
|
||||
if(!empty($provider))
|
||||
{
|
||||
$data = $provider->delete();
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
public function insertReportProvider($inputData){
|
||||
|
||||
return self::create($inputData);
|
||||
}
|
||||
public function updateReportProvider($inputData){
|
||||
$result = [];
|
||||
$provider = self:: where('company_type',$inputData['edit_source_type'])->first();
|
||||
|
||||
if(!empty($provider)){
|
||||
$data['company_type'] = $inputData['edit_source_type'];
|
||||
$data['link'] = $inputData['edit_link'];
|
||||
$result = $provider->update($data);
|
||||
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user