Natinality, Country, Agenda, search Request. CMS
Magazine Content
This commit is contained in:
parent
30d5ca3b44
commit
aebfb0586a
72 changed files with 4636 additions and 590 deletions
|
|
@ -4,6 +4,36 @@ namespace App\Models;
|
|||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* App\Models\TravelCountry
|
||||
*
|
||||
* @property int $id
|
||||
* @property int|null $crm_id
|
||||
* @property string $name
|
||||
* @property string|null $html_information
|
||||
* @property string|null $entry_requirements
|
||||
* @property int|null $feedback_page_id
|
||||
* @property int|null $is_customer_country
|
||||
* @property int|null $active_frontend
|
||||
* @property int|null $active_backend
|
||||
* @property string|null $updated_at
|
||||
* @property string|null $created_at
|
||||
* @property-read \App\Models\Page|null $feedback_page
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\TravelNationalityRequirement[] $travel_nationality_requirements
|
||||
* @property-read \App\Models\TravelProgramCountry $travel_program_country
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereActiveBackend($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereActiveFrontend($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereCrmId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereEntryRequirements($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereFeedbackPageId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereHtmlInformation($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereIsCustomerCountry($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelCountry whereUpdatedAt($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class TravelCountry extends Model
|
||||
{
|
||||
//use the connection to sec. Datebase sterntours
|
||||
|
|
@ -15,6 +45,11 @@ class TravelCountry extends Model
|
|||
protected $fillable = [
|
||||
'name',
|
||||
'html_information',
|
||||
'entry_requirements',
|
||||
'is_customer_country',
|
||||
'active_frontend',
|
||||
'active_backend'
|
||||
|
||||
];
|
||||
|
||||
public $timestamps = false;
|
||||
|
|
@ -23,4 +58,40 @@ class TravelCountry extends Model
|
|||
{
|
||||
return $this->hasOne('App\Models\TravelProgramCountry', 'country_id', 'id');
|
||||
}
|
||||
}
|
||||
|
||||
public function feedback_page()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Page', 'feedback_page_id', 'id');
|
||||
}
|
||||
|
||||
public function travel_nationality_requirements()
|
||||
{
|
||||
return $this->hasMany('App\Models\TravelNationalityRequirement', 'travel_country_id', 'id');
|
||||
}
|
||||
|
||||
|
||||
public function getNationalityRequirement($travel_nationality_id){
|
||||
|
||||
$model = TravelNationalityRequirement::where('travel_country_id', $this->id)->where('travel_nationality_id', $travel_nationality_id)->first();
|
||||
if($model){
|
||||
return $model->text;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public function setNationalityRequirement($travel_nationality_id, $text){
|
||||
$model = TravelNationalityRequirement::where('travel_country_id', $this->id)->where('travel_nationality_id', $travel_nationality_id)->first();
|
||||
if($model){
|
||||
$model->text = $text;
|
||||
$model->save();
|
||||
}else{
|
||||
$data = [
|
||||
'travel_country_id' => $this->id,
|
||||
'travel_nationality_id' => $travel_nationality_id,
|
||||
'text' => $text,
|
||||
];
|
||||
TravelNationalityRequirement::create($data);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue