inital commit
This commit is contained in:
62
app/Models/SafetyAndPrivacy.php
Normal file
62
app/Models/SafetyAndPrivacy.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use App\Traits\SafetyAndPrivacyReportAble;
|
||||
|
||||
class SafetyAndPrivacy extends Model
|
||||
{
|
||||
use SafetyAndPrivacyReportAble;
|
||||
|
||||
protected $fillable = [
|
||||
'recognize_picture',
|
||||
'lat',
|
||||
'lon',
|
||||
'operator_id',
|
||||
'operator_name',
|
||||
'province_id',
|
||||
'province_fa',
|
||||
'city_id',
|
||||
'city_fa',
|
||||
'info_id',
|
||||
'info_fa',
|
||||
'edare_shahri_id',
|
||||
'edare_shahri_name',
|
||||
'way_id',
|
||||
'activity_date_time',
|
||||
|
||||
];
|
||||
|
||||
public $table = "safety_and_privacy";
|
||||
|
||||
public function goToFirstStep()
|
||||
{
|
||||
if($this->step == 0){
|
||||
$this->step = 1;
|
||||
$this->step_fa = 'گام اول (شناسایی)';
|
||||
$this->save();
|
||||
}
|
||||
}
|
||||
|
||||
public function goToSecondStep()
|
||||
{
|
||||
if($this->step == 1){
|
||||
$this->step = 2;
|
||||
$this->step_fa = 'گام دوم (اخطار)';
|
||||
|
||||
|
||||
$this->save();
|
||||
}
|
||||
}
|
||||
|
||||
public function goToThirdStep()
|
||||
{
|
||||
if($this->step == 2){
|
||||
$this->step = 3;
|
||||
$this->step_fa = 'گام سوم (برخورد)';
|
||||
$this->save();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user