63 lines
1.2 KiB
PHP
63 lines
1.2 KiB
PHP
<?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();
|
|
}
|
|
}
|
|
|
|
}
|