mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
zoom in country
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Models;
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
use Spatie\Image\Manipulations;
|
use Spatie\Image\Manipulations;
|
||||||
use Spatie\MediaLibrary\HasMedia;
|
use Spatie\MediaLibrary\HasMedia;
|
||||||
use Spatie\MediaLibrary\InteractsWithMedia;
|
use Spatie\MediaLibrary\InteractsWithMedia;
|
||||||
@@ -34,7 +35,9 @@ class BitcoinEvent extends Model implements HasMedia
|
|||||||
protected static function booted()
|
protected static function booted()
|
||||||
{
|
{
|
||||||
static::creating(function ($model) {
|
static::creating(function ($model) {
|
||||||
|
if (!$model->created_by) {
|
||||||
$model->created_by = auth()->id();
|
$model->created_by = auth()->id();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,12 +59,12 @@ class BitcoinEvent extends Model implements HasMedia
|
|||||||
->useFallbackUrl(asset('img/einundzwanzig-cover-lesestunde.png'));
|
->useFallbackUrl(asset('img/einundzwanzig-cover-lesestunde.png'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function createdBy(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class, 'created_by');
|
return $this->belongsTo(User::class, 'created_by');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function venue(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function venue(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Venue::class);
|
return $this->belongsTo(Venue::class);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ namespace App\Models;
|
|||||||
use Akuechler\Geoly;
|
use Akuechler\Geoly;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
use Spatie\Comments\Models\Concerns\HasComments;
|
use Spatie\Comments\Models\Concerns\HasComments;
|
||||||
use Spatie\Image\Manipulations;
|
use Spatie\Image\Manipulations;
|
||||||
@@ -40,7 +41,9 @@ class BookCase extends Model implements HasMedia
|
|||||||
protected static function booted()
|
protected static function booted()
|
||||||
{
|
{
|
||||||
static::creating(function ($model) {
|
static::creating(function ($model) {
|
||||||
|
if (!$model->created_by) {
|
||||||
$model->created_by = auth()->id();
|
$model->created_by = auth()->id();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,7 +64,7 @@ class BookCase extends Model implements HasMedia
|
|||||||
$this->addMediaCollection('images');
|
$this->addMediaCollection('images');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function createdBy(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class, 'created_by');
|
return $this->belongsTo(User::class, 'created_by');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace App\Models;
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||||
|
|
||||||
class Category extends Model
|
class Category extends Model
|
||||||
{
|
{
|
||||||
@@ -11,21 +12,19 @@ class Category extends Model
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that aren't mass assignable.
|
* The attributes that aren't mass assignable.
|
||||||
*
|
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $guarded = [];
|
protected $guarded = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that should be cast to native types.
|
* The attributes that should be cast to native types.
|
||||||
*
|
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
'id' => 'integer',
|
'id' => 'integer',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function courses(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
public function courses(): BelongsToMany
|
||||||
{
|
{
|
||||||
return $this->belongsToMany(Course::class);
|
return $this->belongsToMany(Course::class);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ namespace App\Models;
|
|||||||
use Akuechler\Geoly;
|
use Akuechler\Geoly;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
use Spatie\Sluggable\HasSlug;
|
use Spatie\Sluggable\HasSlug;
|
||||||
use Spatie\Sluggable\SlugOptions;
|
use Spatie\Sluggable\SlugOptions;
|
||||||
|
|
||||||
@@ -32,7 +34,9 @@ class City extends Model
|
|||||||
protected static function booted()
|
protected static function booted()
|
||||||
{
|
{
|
||||||
static::creating(function ($model) {
|
static::creating(function ($model) {
|
||||||
|
if (!$model->created_by) {
|
||||||
$model->created_by = auth()->id();
|
$model->created_by = auth()->id();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,17 +51,17 @@ class City extends Model
|
|||||||
->usingLanguage('de');
|
->usingLanguage('de');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function createdBy(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class, 'created_by');
|
return $this->belongsTo(User::class, 'created_by');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function country(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function country(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Country::class);
|
return $this->belongsTo(Country::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function venues(): \Illuminate\Database\Eloquent\Relations\HasMany
|
public function venues(): HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(Venue::class);
|
return $this->hasMany(Venue::class);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace App\Models;
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
|
|
||||||
class Country extends Model
|
class Country extends Model
|
||||||
{
|
{
|
||||||
@@ -24,7 +25,7 @@ class Country extends Model
|
|||||||
'language_codes' => 'array',
|
'language_codes' => 'array',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function cities(): \Illuminate\Database\Eloquent\Relations\HasMany
|
public function cities(): HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(City::class);
|
return $this->hasMany(City::class);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ namespace App\Models;
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
use Spatie\Image\Manipulations;
|
use Spatie\Image\Manipulations;
|
||||||
use Spatie\MediaLibrary\HasMedia;
|
use Spatie\MediaLibrary\HasMedia;
|
||||||
use Spatie\MediaLibrary\InteractsWithMedia;
|
use Spatie\MediaLibrary\InteractsWithMedia;
|
||||||
@@ -18,14 +21,12 @@ class Course extends Model implements HasMedia
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that aren't mass assignable.
|
* The attributes that aren't mass assignable.
|
||||||
*
|
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $guarded = [];
|
protected $guarded = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that should be cast to native types.
|
* The attributes that should be cast to native types.
|
||||||
*
|
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
@@ -36,7 +37,9 @@ class Course extends Model implements HasMedia
|
|||||||
protected static function booted()
|
protected static function booted()
|
||||||
{
|
{
|
||||||
static::creating(function ($model) {
|
static::creating(function ($model) {
|
||||||
|
if (!$model->created_by) {
|
||||||
$model->created_by = auth()->id();
|
$model->created_by = auth()->id();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,22 +64,22 @@ class Course extends Model implements HasMedia
|
|||||||
->useFallbackUrl(asset('img/einundzwanzig-cover-lesestunde.png'));
|
->useFallbackUrl(asset('img/einundzwanzig-cover-lesestunde.png'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function createdBy(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class, 'created_by');
|
return $this->belongsTo(User::class, 'created_by');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function categories(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
public function categories(): BelongsToMany
|
||||||
{
|
{
|
||||||
return $this->belongsToMany(Category::class);
|
return $this->belongsToMany(Category::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function lecturer(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function lecturer(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Lecturer::class);
|
return $this->belongsTo(Lecturer::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function courseEvents(): \Illuminate\Database\Eloquent\Relations\HasMany
|
public function courseEvents(): HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(CourseEvent::class);
|
return $this->hasMany(CourseEvent::class);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ namespace App\Models;
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
|
|
||||||
class CourseEvent extends Model
|
class CourseEvent extends Model
|
||||||
{
|
{
|
||||||
@@ -11,14 +13,12 @@ class CourseEvent extends Model
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that aren't mass assignable.
|
* The attributes that aren't mass assignable.
|
||||||
*
|
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $guarded = [];
|
protected $guarded = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that should be cast to native types.
|
* The attributes that should be cast to native types.
|
||||||
*
|
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
@@ -32,26 +32,28 @@ class CourseEvent extends Model
|
|||||||
protected static function booted()
|
protected static function booted()
|
||||||
{
|
{
|
||||||
static::creating(function ($model) {
|
static::creating(function ($model) {
|
||||||
|
if (!$model->created_by) {
|
||||||
$model->created_by = auth()->id();
|
$model->created_by = auth()->id();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function createdBy(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class, 'created_by');
|
return $this->belongsTo(User::class, 'created_by');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function course(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function course(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Course::class);
|
return $this->belongsTo(Course::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function venue(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function venue(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Venue::class);
|
return $this->belongsTo(Venue::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function registrations(): \Illuminate\Database\Eloquent\Relations\HasMany
|
public function registrations(): HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(Registration::class);
|
return $this->hasMany(Registration::class);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace App\Models;
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||||
use Spatie\Tags\HasTags;
|
use Spatie\Tags\HasTags;
|
||||||
|
|
||||||
@@ -31,16 +32,18 @@ class Episode extends Model
|
|||||||
protected static function booted()
|
protected static function booted()
|
||||||
{
|
{
|
||||||
static::creating(function ($model) {
|
static::creating(function ($model) {
|
||||||
|
if (!$model->created_by) {
|
||||||
$model->created_by = auth()->id();
|
$model->created_by = auth()->id();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function createdBy(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class, 'created_by');
|
return $this->belongsTo(User::class, 'created_by');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function podcast(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function podcast(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Podcast::class);
|
return $this->belongsTo(Podcast::class);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ namespace App\Models;
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
use Spatie\Image\Manipulations;
|
use Spatie\Image\Manipulations;
|
||||||
use Spatie\MediaLibrary\HasMedia;
|
use Spatie\MediaLibrary\HasMedia;
|
||||||
use Spatie\MediaLibrary\InteractsWithMedia;
|
use Spatie\MediaLibrary\InteractsWithMedia;
|
||||||
@@ -35,8 +37,12 @@ class Lecturer extends Model implements HasMedia
|
|||||||
protected static function booted()
|
protected static function booted()
|
||||||
{
|
{
|
||||||
static::creating(function ($model) {
|
static::creating(function ($model) {
|
||||||
|
if (!$model->created_by) {
|
||||||
$model->created_by = auth()->id();
|
$model->created_by = auth()->id();
|
||||||
|
}
|
||||||
|
if (!$model->team_id) {
|
||||||
$model->team_id = auth()->user()->current_team_id;
|
$model->team_id = auth()->user()->current_team_id;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,22 +78,22 @@ class Lecturer extends Model implements HasMedia
|
|||||||
->usingLanguage('de');
|
->usingLanguage('de');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function createdBy(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class, 'created_by');
|
return $this->belongsTo(User::class, 'created_by');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function team(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function team(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Team::class);
|
return $this->belongsTo(Team::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function courses(): \Illuminate\Database\Eloquent\Relations\HasMany
|
public function courses(): HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(Course::class);
|
return $this->hasMany(Course::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function libraryItems(): \Illuminate\Database\Eloquent\Relations\HasMany
|
public function libraryItems(): HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(LibraryItem::class);
|
return $this->hasMany(LibraryItem::class);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ namespace App\Models;
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||||
|
|
||||||
class Library extends Model
|
class Library extends Model
|
||||||
{
|
{
|
||||||
@@ -11,14 +13,12 @@ class Library extends Model
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that aren't mass assignable.
|
* The attributes that aren't mass assignable.
|
||||||
*
|
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $guarded = [];
|
protected $guarded = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that should be cast to native types.
|
* The attributes that should be cast to native types.
|
||||||
*
|
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
@@ -29,16 +29,18 @@ class Library extends Model
|
|||||||
protected static function booted()
|
protected static function booted()
|
||||||
{
|
{
|
||||||
static::creating(function ($model) {
|
static::creating(function ($model) {
|
||||||
|
if (!$model->created_by) {
|
||||||
$model->created_by = auth()->id();
|
$model->created_by = auth()->id();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function createdBy(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class, 'created_by');
|
return $this->belongsTo(User::class, 'created_by');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function libraryItems(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
public function libraryItems(): BelongsToMany
|
||||||
{
|
{
|
||||||
return $this->belongsToMany(LibraryItem::class);
|
return $this->belongsToMany(LibraryItem::class);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ namespace App\Models;
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||||
use Spatie\EloquentSortable\Sortable;
|
use Spatie\EloquentSortable\Sortable;
|
||||||
use Spatie\EloquentSortable\SortableTrait;
|
use Spatie\EloquentSortable\SortableTrait;
|
||||||
use Spatie\Image\Manipulations;
|
use Spatie\Image\Manipulations;
|
||||||
@@ -40,7 +42,9 @@ class LibraryItem extends Model implements HasMedia, Sortable
|
|||||||
protected static function booted()
|
protected static function booted()
|
||||||
{
|
{
|
||||||
static::creating(function ($model) {
|
static::creating(function ($model) {
|
||||||
|
if (!$model->created_by) {
|
||||||
$model->created_by = auth()->id();
|
$model->created_by = auth()->id();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,22 +72,22 @@ class LibraryItem extends Model implements HasMedia, Sortable
|
|||||||
->useFallbackUrl(asset('img/einundzwanzig-cover-lesestunde.png'));
|
->useFallbackUrl(asset('img/einundzwanzig-cover-lesestunde.png'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function createdBy(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class, 'created_by');
|
return $this->belongsTo(User::class, 'created_by');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function lecturer(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function lecturer(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Lecturer::class);
|
return $this->belongsTo(Lecturer::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function episode(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function episode(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Episode::class);
|
return $this->belongsTo(Episode::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function libraries(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
public function libraries(): BelongsToMany
|
||||||
{
|
{
|
||||||
return $this->belongsToMany(Library::class);
|
return $this->belongsToMany(Library::class);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace App\Models;
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
use Spatie\Image\Manipulations;
|
use Spatie\Image\Manipulations;
|
||||||
use Spatie\MediaLibrary\HasMedia;
|
use Spatie\MediaLibrary\HasMedia;
|
||||||
@@ -33,7 +34,9 @@ class Meetup extends Model implements HasMedia
|
|||||||
protected static function booted()
|
protected static function booted()
|
||||||
{
|
{
|
||||||
static::creating(function ($model) {
|
static::creating(function ($model) {
|
||||||
|
if (!$model->created_by) {
|
||||||
$model->created_by = auth()->id();
|
$model->created_by = auth()->id();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,12 +58,12 @@ class Meetup extends Model implements HasMedia
|
|||||||
->useFallbackUrl(asset('img/einundzwanzig-cover-lesestunde.png'));
|
->useFallbackUrl(asset('img/einundzwanzig-cover-lesestunde.png'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function createdBy(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class, 'created_by');
|
return $this->belongsTo(User::class, 'created_by');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function city(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function city(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(City::class);
|
return $this->belongsTo(City::class);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace App\Models;
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
|
||||||
class MeetupEvent extends Model
|
class MeetupEvent extends Model
|
||||||
{
|
{
|
||||||
@@ -11,14 +12,12 @@ class MeetupEvent extends Model
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that aren't mass assignable.
|
* The attributes that aren't mass assignable.
|
||||||
*
|
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $guarded = [];
|
protected $guarded = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that should be cast to native types.
|
* The attributes that should be cast to native types.
|
||||||
*
|
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
@@ -30,16 +29,18 @@ class MeetupEvent extends Model
|
|||||||
protected static function booted()
|
protected static function booted()
|
||||||
{
|
{
|
||||||
static::creating(function ($model) {
|
static::creating(function ($model) {
|
||||||
|
if (!$model->created_by) {
|
||||||
$model->created_by = auth()->id();
|
$model->created_by = auth()->id();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function createdBy(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class, 'created_by');
|
return $this->belongsTo(User::class, 'created_by');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function meetup(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function meetup(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Meetup::class);
|
return $this->belongsTo(Meetup::class);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ class Membership extends JetstreamMembership
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Indicates if the IDs are auto-incrementing.
|
* Indicates if the IDs are auto-incrementing.
|
||||||
*
|
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
public $incrementing = true;
|
public $incrementing = true;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace App\Models;
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
|
||||||
class OrangePill extends Model
|
class OrangePill extends Model
|
||||||
{
|
{
|
||||||
@@ -11,14 +12,12 @@ class OrangePill extends Model
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that aren't mass assignable.
|
* The attributes that aren't mass assignable.
|
||||||
*
|
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $guarded = [];
|
protected $guarded = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that should be cast to native types.
|
* The attributes that should be cast to native types.
|
||||||
*
|
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
@@ -28,12 +27,12 @@ class OrangePill extends Model
|
|||||||
'date' => 'datetime',
|
'date' => 'datetime',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function user(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class);
|
return $this->belongsTo(User::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function bookCase(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function bookCase(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(BookCase::class);
|
return $this->belongsTo(BookCase::class);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,6 +25,6 @@ class Participant extends Model
|
|||||||
|
|
||||||
public function registrations()
|
public function registrations()
|
||||||
{
|
{
|
||||||
return $this->hasMany(\App\Models\Registration::class);
|
return $this->hasMany(Registration::class);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace App\Models;
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
|
|
||||||
class Podcast extends Model
|
class Podcast extends Model
|
||||||
@@ -28,11 +29,13 @@ class Podcast extends Model
|
|||||||
protected static function booted()
|
protected static function booted()
|
||||||
{
|
{
|
||||||
static::creating(function ($model) {
|
static::creating(function ($model) {
|
||||||
|
if (!$model->created_by) {
|
||||||
$model->created_by = auth()->id();
|
$model->created_by = auth()->id();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function createdBy(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class, 'created_by');
|
return $this->belongsTo(User::class, 'created_by');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ namespace App\Models;
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
|
||||||
class Registration extends Model
|
class Registration extends Model
|
||||||
{
|
{
|
||||||
@@ -11,14 +12,12 @@ class Registration extends Model
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that aren't mass assignable.
|
* The attributes that aren't mass assignable.
|
||||||
*
|
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $guarded = [];
|
protected $guarded = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that should be cast to native types.
|
* The attributes that should be cast to native types.
|
||||||
*
|
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
@@ -28,12 +27,12 @@ class Registration extends Model
|
|||||||
'active' => 'boolean',
|
'active' => 'boolean',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function courseEvent(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function courseEvent(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(CourseEvent::class);
|
return $this->belongsTo(CourseEvent::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function participant(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function participant(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Participant::class);
|
return $this->belongsTo(Participant::class);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ class Team extends JetstreamTeam
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that should be cast.
|
* The attributes that should be cast.
|
||||||
*
|
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $casts = [
|
protected $casts = [
|
||||||
@@ -23,7 +22,6 @@ class Team extends JetstreamTeam
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that are mass assignable.
|
* The attributes that are mass assignable.
|
||||||
*
|
|
||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
@@ -33,7 +31,6 @@ class Team extends JetstreamTeam
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* The event map for the model.
|
* The event map for the model.
|
||||||
*
|
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $dispatchesEvents = [
|
protected $dispatchesEvents = [
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ class TeamInvitation extends JetstreamTeamInvitation
|
|||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The attributes that are mass assignable.
|
* The attributes that are mass assignable.
|
||||||
*
|
|
||||||
* @var string[]
|
* @var string[]
|
||||||
*/
|
*/
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
@@ -19,7 +18,6 @@ class TeamInvitation extends JetstreamTeamInvitation
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the team that the invitation belongs to.
|
* Get the team that the invitation belongs to.
|
||||||
*
|
|
||||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
*/
|
*/
|
||||||
public function team()
|
public function team()
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ namespace App\Models;
|
|||||||
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
use Spatie\Image\Manipulations;
|
use Spatie\Image\Manipulations;
|
||||||
use Spatie\MediaLibrary\HasMedia;
|
use Spatie\MediaLibrary\HasMedia;
|
||||||
use Spatie\MediaLibrary\InteractsWithMedia;
|
use Spatie\MediaLibrary\InteractsWithMedia;
|
||||||
@@ -37,7 +39,9 @@ class Venue extends Model implements HasMedia
|
|||||||
protected static function booted()
|
protected static function booted()
|
||||||
{
|
{
|
||||||
static::creating(function ($model) {
|
static::creating(function ($model) {
|
||||||
|
if (!$model->created_by) {
|
||||||
$model->created_by = auth()->id();
|
$model->created_by = auth()->id();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,12 +74,12 @@ class Venue extends Model implements HasMedia
|
|||||||
->usingLanguage('de');
|
->usingLanguage('de');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function createdBy(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class, 'created_by');
|
return $this->belongsTo(User::class, 'created_by');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function city(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function city(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(City::class);
|
return $this->belongsTo(City::class);
|
||||||
}
|
}
|
||||||
@@ -90,7 +94,7 @@ class Venue extends Model implements HasMedia
|
|||||||
return $this->hasManyDeepFromRelations($this->events(), (new CourseEvent())->course());
|
return $this->hasManyDeepFromRelations($this->events(), (new CourseEvent())->course());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function courseEvents(): \Illuminate\Database\Eloquent\Relations\HasMany
|
public function courseEvents(): HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(CourseEvent::class);
|
return $this->hasMany(CourseEvent::class);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ use Illuminate\Http\Request;
|
|||||||
use Laravel\Nova\Fields\HasMany;
|
use Laravel\Nova\Fields\HasMany;
|
||||||
use Laravel\Nova\Fields\ID;
|
use Laravel\Nova\Fields\ID;
|
||||||
use Laravel\Nova\Fields\MultiSelect;
|
use Laravel\Nova\Fields\MultiSelect;
|
||||||
|
use Laravel\Nova\Fields\Number;
|
||||||
use Laravel\Nova\Fields\Text;
|
use Laravel\Nova\Fields\Text;
|
||||||
use Laravel\Nova\Http\Requests\NovaRequest;
|
use Laravel\Nova\Http\Requests\NovaRequest;
|
||||||
|
|
||||||
@@ -77,6 +78,16 @@ class Country extends Resource
|
|||||||
Text::make(__('Code'), 'code')
|
Text::make(__('Code'), 'code')
|
||||||
->rules('required', 'string'),
|
->rules('required', 'string'),
|
||||||
|
|
||||||
|
Number::make(__('Latitude'), 'latitude')
|
||||||
|
->rules('required', 'numeric')
|
||||||
|
->step(0.000001)
|
||||||
|
->help('<a target="_blank" href="https://www.latlong.net/">https://www.latlong.net/</a>'),
|
||||||
|
|
||||||
|
Number::make(__('Longitude'), 'longitude')
|
||||||
|
->rules('required', 'numeric')
|
||||||
|
->step(0.000001)
|
||||||
|
->help('<a target="_blank" href="https://www.latlong.net/">https://www.latlong.net/</a>'),
|
||||||
|
|
||||||
HasMany::make(__('Cities'), 'cities', City::class),
|
HasMany::make(__('Cities'), 'cities', City::class),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration {
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('countries', function (Blueprint $table) {
|
||||||
|
$table->double('longitude')
|
||||||
|
->nullable();
|
||||||
|
$table->double('latitude')
|
||||||
|
->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('countries', function (Blueprint $table) {
|
||||||
|
//
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -76,6 +76,13 @@ class DatabaseSeeder extends Seeder
|
|||||||
'code' => 'fr',
|
'code' => 'fr',
|
||||||
'language_codes' => ['fr'],
|
'language_codes' => ['fr'],
|
||||||
]);
|
]);
|
||||||
|
Country::create([
|
||||||
|
'name' => 'Serbia',
|
||||||
|
'code' => 'rs',
|
||||||
|
'language_codes' => ['rs'],
|
||||||
|
'longitude' => 21,
|
||||||
|
'latitude' => 44,
|
||||||
|
]);
|
||||||
City::create([
|
City::create([
|
||||||
'country_id' => 1,
|
'country_id' => 1,
|
||||||
'name' => 'Füssen',
|
'name' => 'Füssen',
|
||||||
|
|||||||
@@ -13,9 +13,11 @@
|
|||||||
<p class="px-0 mb-6 text-lg text-gray-600 md:text-xl lg:px-24"> Finde Bitcoiner in deiner Stadt und lerne
|
<p class="px-0 mb-6 text-lg text-gray-600 md:text-xl lg:px-24"> Finde Bitcoiner in deiner Stadt und lerne
|
||||||
sie auf einem der Meetups kennen. </p>
|
sie auf einem der Meetups kennen. </p>
|
||||||
@php
|
@php
|
||||||
|
$focus = '';
|
||||||
$map = $country->code . '_merc';
|
$map = $country->code . '_merc';
|
||||||
if (!\File::exists(public_path('vendor/jvector/maps/' . $country->code . '.js'))) {
|
if (!\File::exists(public_path('vendor/jvector/maps/' . $country->code . '.js'))) {
|
||||||
$map = 'europe_merc';
|
$map = 'europe_merc';
|
||||||
|
$focus = 'focusOn: {lat:'.$country->latitude.',lng:'.$country->longitude.',scale:8,animate:true},';
|
||||||
}
|
}
|
||||||
@endphp
|
@endphp
|
||||||
<div
|
<div
|
||||||
@@ -26,6 +28,7 @@
|
|||||||
let markers = {{ Js::from($markers) }};
|
let markers = {{ Js::from($markers) }};
|
||||||
|
|
||||||
$('#map').vectorMap({
|
$('#map').vectorMap({
|
||||||
|
{{ $focus }}
|
||||||
zoomButtons : false,
|
zoomButtons : false,
|
||||||
zoomOnScroll: true,
|
zoomOnScroll: true,
|
||||||
map: '{{ $map }}',
|
map: '{{ $map }}',
|
||||||
|
|||||||
Reference in New Issue
Block a user