travel guide
This commit is contained in:
parent
346a7427a5
commit
a1ca534f55
26 changed files with 5788 additions and 3191 deletions
86
app/Models/TravelGuide.php
Normal file
86
app/Models/TravelGuide.php
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Cviebrock\EloquentSluggable\Sluggable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* App\Models\TravelMagazine
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property string $slug
|
||||
* @property string|null $text
|
||||
* @property string|null $full_text
|
||||
* @property string|null $meta_title
|
||||
* @property string|null $meta_description
|
||||
* @property string|null $meta_keywords
|
||||
* @property int|null $pos
|
||||
* @property int $scope
|
||||
* @property int $active
|
||||
* @property \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelGuide findSimilarSlugs($attribute, $config, $slug)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelGuide whereActive($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelGuide whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelGuide whereFullText($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelGuide whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelGuide whereMetaDescription($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelGuide whereMetaKeywords($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelGuide whereMetaTitle($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelGuide whereName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelGuide wherePos($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelGuide whereScope($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelGuide whereSlug($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelGuide whereText($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\TravelGuide whereUpdatedAt($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class TravelGuide extends Model
|
||||
{
|
||||
|
||||
use Sluggable;
|
||||
|
||||
|
||||
//use the connection to sec. Datebase sterntours
|
||||
protected $connection = 'mysql_stern';
|
||||
|
||||
protected $table = 'travel_guides';
|
||||
|
||||
|
||||
protected static $scopes = [
|
||||
0 => 'Kurze Version',
|
||||
1 => 'Lange Version',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'name', 'slug', 'text', 'full_text', 'meta_title', 'meta_description', 'meta_keywords', 'pos', 'scope', 'active',
|
||||
];
|
||||
|
||||
public function sluggable()
|
||||
{
|
||||
return [
|
||||
'slug' => [
|
||||
'source' => 'name'
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
public static function getScopeOptions($setKey = false){
|
||||
$options = self::$scopes;
|
||||
$ret = "";
|
||||
foreach ($options as $key => $option){
|
||||
$attr = ($key == $setKey) ? 'selected="selected"' : '';
|
||||
$ret .= '<option value="'.$key.'" '.$attr.'>'.$option.'</option>\n';
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
public function getScopeName($key = 0){
|
||||
return isset(self::$scopes[$key]) ? self::$scopes[$key] : '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue