Travel Guide Frontend Backend

This commit is contained in:
Kevin Adametz 2020-08-07 16:00:55 +02:00
parent e6cc042aee
commit 0857a34766
681 changed files with 6680 additions and 1689 deletions

View file

@ -0,0 +1,96 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
/**
* Class AnswerQuestion
*
* @property int $id
* @property string $question
* @property string $question_text
* @property string $answer
* @property string $answer_text
* @property bool $active
* @property Carbon $created_at
* @property Carbon $updated_at
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AnswerQuestion newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AnswerQuestion newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AnswerQuestion query()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AnswerQuestion whereActive($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AnswerQuestion whereAnswer($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AnswerQuestion whereAnswerText($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AnswerQuestion whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AnswerQuestion whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AnswerQuestion whereQuestion($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AnswerQuestion whereQuestionText($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AnswerQuestion whereUpdatedAt($value)
* @mixin \Eloquent
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\IQContentFaq[] $iq_content_faq
* @property-read int|null $iq_content_faq_count
* @property int|null $i_q_content_category_id
* @property-read \App\Models\IQContentCategory|null $iq_content_category
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\AnswerQuestion whereIQContentCategoryId($value)
*/
class AnswerQuestion extends Model
{
protected $connection = 'mysql_stern';
protected $table = 'answer_questions';
protected $casts = [
'active' => 'bool'
];
protected $fillable = [
'i_q_content_category_id',
'question',
'question_text',
'answer',
'answer_text',
'active'
];
public function iq_content_category()
{
return $this->belongsTo(IQContentCategory::class, 'i_q_content_category_id');
}
public function iq_content_faq()
{
return $this->hasMany(IQContentFaq::class, 'faq_id', 'id');
}
public static function getSiteOptions($id, $identifier, $html = true, $choose = true) {
$values = [];
$ret = "";
$models = AnswerQuestion::with('iq_content_category')->select('answer_questions.*')->where('answer_questions.active', 1)//->where('iq_content_category.identifier', $identifier)
->whereHas('iq_content_category', function ($q) use ($identifier) {
$q->where('slug', 'reisefuehrer');
})->get();
if($html) {
if($choose){
$ret .= '<option value="">Bitte wählen</option>\n';
}
foreach ($models as $model) {
$attr = ($model->id == $id) ? ' selected="selected"' : '';
$ret .= '<option value="' . $model->id . '"' . $attr . '>' . $model->question . '</option>\n';
}
return $ret;
}else{
foreach ($models as $model) {
$values[$model->id] = $model->question;
}
return $values;
}
return false;
}
}

View file

@ -167,6 +167,14 @@ use Illuminate\Database\Eloquent\Model;
* @property-read int|null $booking_country_services_count
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\BookingCountryService[] $booking_country_services_checked
* @property-read int|null $booking_country_services_checked_count
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\BookingCompanyService[] $booking_company_services
* @property-read int|null $booking_company_services_count
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\BookingCompanyService[] $booking_company_services_checked
* @property-read int|null $booking_company_services_checked_count
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\BookingProviderService[] $booking_provider_services
* @property-read int|null $booking_provider_services_count
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\BookingProviderService[] $booking_provider_services_checked
* @property-read int|null $booking_provider_services_checked_count
*/
class Booking extends Model
{

View file

@ -25,6 +25,8 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSAuthor whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSAuthor whereUpdatedAt($value)
* @mixin \Eloquent
* @property string|null $description
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\CMSAuthor whereDescription($value)
*/
class CMSAuthor extends Model
{
@ -33,6 +35,7 @@ class CMSAuthor extends Model
protected $table = 'c_m_s_authors';
protected $fillable = [
'name'
'name',
'description',
];
}

View file

@ -0,0 +1,77 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Cviebrock\EloquentSluggable\Sluggable;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
/**
* Class IQContentCategory
*
* @property int $id
* @property string $name
* @property string $slug
* @property string $identifier
* @property int $pos
* @property bool $active
* @property Carbon $created_at
* @property Carbon $updated_at
* @property Collection|IQContentTag[] $i_q_content_tags
* @package App\Models
* @property-read int|null $i_q_content_tags_count
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentCategory findSimilarSlugs($attribute, $config, $slug)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentCategory newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentCategory newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentCategory query()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentCategory whereActive($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentCategory whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentCategory whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentCategory whereIdentifier($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentCategory whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentCategory wherePos($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentCategory whereSlug($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentCategory whereUpdatedAt($value)
* @mixin \Eloquent
*/
class IQContentCategory extends Model
{
use Sluggable;
protected $connection = 'mysql_stern';
protected $table = 'i_q_content_categories';
protected $casts = [
'pos' => 'int',
'active' => 'bool'
];
protected $fillable = [
'name',
'slug',
'identifier',
'pos',
'active'
];
public function sluggable()
{
return [
'slug' => [
'source' => 'name'
]
];
}
public function i_q_content_tags()
{
return $this->hasMany(IQContentTag::class, 'category_id');
}
}

View file

@ -0,0 +1,53 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
/**
* Class IQContentFaq
*
* @property int $id
* @property int $tree_node_id
* @property int $faq_id
* @property Carbon $created_at
* @property Carbon $updated_at
* @property AnswerQuestion $answer_question
* @property IQContentTreeNode $i_q_content_tree_node
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentFaq newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentFaq newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentFaq query()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentFaq whereTreeNodeId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentFaq whereFaqId($value)
* @mixin \Eloquent
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentFaq whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentFaq whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentFaq whereUpdatedAt($value)
*/
class IQContentFaq extends Model
{
protected $connection = 'mysql_stern';
protected $table = 'i_q_content_faqs';
protected $fillable = [
'tree_node_id',
'faq_id'
];
public function answer_question()
{
return $this->belongsTo(AnswerQuestion::class, 'faq_id');
}
public function i_q_content_tree_node()
{
return $this->belongsTo(IQContentTreeNode::class, 'tree_node_id');
}
}

View file

@ -0,0 +1,59 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Model;
/**
* Class IQContentFileTag
*
* @property int $id
* @property int $file_id
* @property int $tag_id
* @property Carbon $created_at
* @property Carbon $updated_at
*
* //* @property IQContentFile $i_q_content_file
* @property IQContentTag $i_q_content_tag
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentFileTag newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentFileTag newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentFileTag query()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentFileTag whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentFileTag whereFileId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentFileTag whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentFileTag whereTagId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentFileTag whereUpdatedAt($value)
* @mixin \Eloquent
*/
class IQContentFileTag extends Model
{
protected $connection = 'mysql_stern';
protected $table = 'i_q_content_file_tags';
protected $casts = [
'file_id' => 'int',
'tag_id' => 'int'
];
protected $fillable = [
'file_id',
'tag_id'
];
/*public function i_q_content_file()
{
return $this->belongsTo(IQContentFile::class, 'file_id');
}*/
public function i_q_content_tag()
{
return $this->belongsTo(IQContentTag::class, 'tag_id');
}
}

View file

@ -23,6 +23,8 @@ use Illuminate\Database\Eloquent\Model;
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentSite whereTreeNodeId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentSite whereUpdatedAt($value)
* @mixin \Eloquent
* @property string|null $identifier
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentSite whereIdentifier($value)
*/
class IQContentSite extends Model
{
@ -31,9 +33,14 @@ class IQContentSite extends Model
protected $table = 'i_q_content_sites';
protected $fillable = [
'tree_node_id', 'travel_guide_id',
'tree_node_id', 'travel_guide_id', 'identifier',
];
public static $travelTypes = [
''=>'keine',
'long'=>'Lange Version',
'short'=>'Kurze Version',
];
public function iq_content_tree_node()
{
return $this->belongsTo('App\Models\IQContentTreeNode', 'tree_node_id');
@ -44,4 +51,7 @@ class IQContentSite extends Model
return $this->belongsTo('App\Models\TravelGuide', 'travel_guide_id');
}
public function getTravelType(){
return isset(self::$travelTypes[$this->attributes['identifier']]) ? self::$travelTypes[$this->attributes['identifier']] : "";
}
}

View file

@ -0,0 +1,69 @@
<?php
/**
* Created by Reliese Model.
*/
namespace App\Models;
use Carbon\Carbon;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Database\Eloquent\Model;
/**
* Class IQContentTag
*
* @property int $id
* @property int $category_id
* @property string $name
* @property string $slug
* @property int $pos
* @property bool $active
* @property Carbon $created_at
* @property Carbon $updated_at
* @property IQContentCategory $i_q_content_category
* // * @property Collection|IQContentFileTag[] $i_q_content_file_tags
* @package App\Models
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentTag newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentTag newQuery()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentTag query()
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentTag whereActive($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentTag whereCategoryId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentTag whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentTag whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentTag whereName($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentTag wherePos($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentTag whereSlug($value)
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentTag whereUpdatedAt($value)
* @mixin \Eloquent
*/
class IQContentTag extends Model
{
protected $connection = 'mysql_stern';
protected $table = 'i_q_content_tags';
protected $casts = [
'category_id' => 'int',
'pos' => 'int',
'active' => 'bool'
];
protected $fillable = [
'category_id',
'name',
'slug',
'pos',
'active'
];
public function i_q_content_category()
{
return $this->belongsTo(IQContentCategory::class, 'category_id');
}
/*public function i_q_content_file_tags()
{
return $this->hasMany(IQContentFileTag::class, 'tag_id');
}*/
}

View file

@ -57,6 +57,12 @@ use Illuminate\Support\Str;
* @property-read int|null $iq_content_tree_node_childs_count
* @property string|null $title
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentTreeNode whereTitle($value)
* @property array|null $image
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\IQContentTreeNode whereImage($value)
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\IQContentFaq[] $iq_content_faq
* @property-read int|null $iq_content_faq_count
* @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\IQContentFaq[] $iq_content_faqs
* @property-read int|null $iq_content_faqs_count
*/
class IQContentTreeNode extends Model
{
@ -70,10 +76,10 @@ class IQContentTreeNode extends Model
protected $table = 'i_q_content_tree_nodes';
protected $fillable = [
'tree_id', 'parent_id', 'lvl', 'name', 'identifier', 'title', 'description', 'settings', 'pos', 'active',
'tree_id', 'parent_id', 'lvl', 'name', 'identifier', 'title', 'description', 'settings', 'image', 'pos', 'active',
];
protected $casts = ['settings' => 'array'];
protected $casts = ['settings' => 'array', 'image' => 'array'];
public function sluggable()
{
@ -104,6 +110,11 @@ class IQContentTreeNode extends Model
return $this->hasMany('App\Models\IQContentSite', 'tree_node_id', 'id');
}
public function iq_content_faqs()
{
return $this->hasMany('App\Models\IQContentFaq', 'tree_node_id', 'id');
}
public function iq_content_site_first()
{
foreach ($this->iq_content_sites as $iq_content_site) {
@ -142,7 +153,12 @@ class IQContentTreeNode extends Model
return $ret.$node_parent->identifier."/";
}
}
public function getImage($key){
if(isset($this->image[$key])){
return $this->image[$key];
}
return "";
}
public static function getTreeNodeOptions($tree_id, $id = false, $html = true, $choose = true) {
$values = [];