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\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Spatie\Image\Manipulations;
|
||||
use Spatie\MediaLibrary\HasMedia;
|
||||
use Spatie\MediaLibrary\InteractsWithMedia;
|
||||
@@ -34,7 +35,9 @@ class BitcoinEvent extends Model implements HasMedia
|
||||
protected static function booted()
|
||||
{
|
||||
static::creating(function ($model) {
|
||||
$model->created_by = auth()->id();
|
||||
if (!$model->created_by) {
|
||||
$model->created_by = auth()->id();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -56,12 +59,12 @@ class BitcoinEvent extends Model implements HasMedia
|
||||
->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');
|
||||
}
|
||||
|
||||
public function venue(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function venue(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Venue::class);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace App\Models;
|
||||
use Akuechler\Geoly;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Spatie\Comments\Models\Concerns\HasComments;
|
||||
use Spatie\Image\Manipulations;
|
||||
@@ -40,7 +41,9 @@ class BookCase extends Model implements HasMedia
|
||||
protected static function booted()
|
||||
{
|
||||
static::creating(function ($model) {
|
||||
$model->created_by = auth()->id();
|
||||
if (!$model->created_by) {
|
||||
$model->created_by = auth()->id();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -61,7 +64,7 @@ class BookCase extends Model implements HasMedia
|
||||
$this->addMediaCollection('images');
|
||||
}
|
||||
|
||||
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function createdBy(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'created_by');
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
class Category extends Model
|
||||
{
|
||||
@@ -11,21 +12,19 @@ class Category extends Model
|
||||
|
||||
/**
|
||||
* The attributes that aren't mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'id' => 'integer',
|
||||
];
|
||||
|
||||
public function courses(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function courses(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Course::class);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@ namespace App\Models;
|
||||
use Akuechler\Geoly;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Spatie\Sluggable\HasSlug;
|
||||
use Spatie\Sluggable\SlugOptions;
|
||||
|
||||
@@ -32,7 +34,9 @@ class City extends Model
|
||||
protected static function booted()
|
||||
{
|
||||
static::creating(function ($model) {
|
||||
$model->created_by = auth()->id();
|
||||
if (!$model->created_by) {
|
||||
$model->created_by = auth()->id();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -47,17 +51,17 @@ class City extends Model
|
||||
->usingLanguage('de');
|
||||
}
|
||||
|
||||
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function createdBy(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'created_by');
|
||||
}
|
||||
|
||||
public function country(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function country(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Country::class);
|
||||
}
|
||||
|
||||
public function venues(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function venues(): HasMany
|
||||
{
|
||||
return $this->hasMany(Venue::class);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class Country extends Model
|
||||
{
|
||||
@@ -24,7 +25,7 @@ class Country extends Model
|
||||
'language_codes' => 'array',
|
||||
];
|
||||
|
||||
public function cities(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function cities(): HasMany
|
||||
{
|
||||
return $this->hasMany(City::class);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,9 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
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\MediaLibrary\HasMedia;
|
||||
use Spatie\MediaLibrary\InteractsWithMedia;
|
||||
@@ -18,25 +21,25 @@ class Course extends Model implements HasMedia
|
||||
|
||||
/**
|
||||
* The attributes that aren't mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'id' => 'integer',
|
||||
'id' => 'integer',
|
||||
'lecturer_id' => 'integer',
|
||||
];
|
||||
|
||||
protected static function booted()
|
||||
{
|
||||
static::creating(function ($model) {
|
||||
$model->created_by = auth()->id();
|
||||
if (!$model->created_by) {
|
||||
$model->created_by = auth()->id();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -61,22 +64,22 @@ class Course extends Model implements HasMedia
|
||||
->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');
|
||||
}
|
||||
|
||||
public function categories(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function categories(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Category::class);
|
||||
}
|
||||
|
||||
public function lecturer(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function lecturer(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Lecturer::class);
|
||||
}
|
||||
|
||||
public function courseEvents(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function courseEvents(): HasMany
|
||||
{
|
||||
return $this->hasMany(CourseEvent::class);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class CourseEvent extends Model
|
||||
{
|
||||
@@ -11,47 +13,47 @@ class CourseEvent extends Model
|
||||
|
||||
/**
|
||||
* The attributes that aren't mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'id' => 'integer',
|
||||
'id' => 'integer',
|
||||
'course_id' => 'integer',
|
||||
'venue_id' => 'integer',
|
||||
'from' => 'datetime',
|
||||
'to' => 'datetime',
|
||||
'venue_id' => 'integer',
|
||||
'from' => 'datetime',
|
||||
'to' => 'datetime',
|
||||
];
|
||||
|
||||
protected static function booted()
|
||||
{
|
||||
static::creating(function ($model) {
|
||||
$model->created_by = auth()->id();
|
||||
if (!$model->created_by) {
|
||||
$model->created_by = auth()->id();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function createdBy(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'created_by');
|
||||
}
|
||||
|
||||
public function course(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function course(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Course::class);
|
||||
}
|
||||
|
||||
public function venue(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function venue(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Venue::class);
|
||||
}
|
||||
|
||||
public function registrations(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function registrations(): HasMany
|
||||
{
|
||||
return $this->hasMany(Registration::class);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
use Spatie\Tags\HasTags;
|
||||
|
||||
@@ -31,16 +32,18 @@ class Episode extends Model
|
||||
protected static function booted()
|
||||
{
|
||||
static::creating(function ($model) {
|
||||
$model->created_by = auth()->id();
|
||||
if (!$model->created_by) {
|
||||
$model->created_by = auth()->id();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function createdBy(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'created_by');
|
||||
}
|
||||
|
||||
public function podcast(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function podcast(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Podcast::class);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Spatie\Image\Manipulations;
|
||||
use Spatie\MediaLibrary\HasMedia;
|
||||
use Spatie\MediaLibrary\InteractsWithMedia;
|
||||
@@ -35,8 +37,12 @@ class Lecturer extends Model implements HasMedia
|
||||
protected static function booted()
|
||||
{
|
||||
static::creating(function ($model) {
|
||||
$model->created_by = auth()->id();
|
||||
$model->team_id = auth()->user()->current_team_id;
|
||||
if (!$model->created_by) {
|
||||
$model->created_by = auth()->id();
|
||||
}
|
||||
if (!$model->team_id) {
|
||||
$model->team_id = auth()->user()->current_team_id;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -72,22 +78,22 @@ class Lecturer extends Model implements HasMedia
|
||||
->usingLanguage('de');
|
||||
}
|
||||
|
||||
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function createdBy(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'created_by');
|
||||
}
|
||||
|
||||
public function team(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function team(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Team::class);
|
||||
}
|
||||
|
||||
public function courses(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function courses(): HasMany
|
||||
{
|
||||
return $this->hasMany(Course::class);
|
||||
}
|
||||
|
||||
public function libraryItems(): \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
public function libraryItems(): HasMany
|
||||
{
|
||||
return $this->hasMany(LibraryItem::class);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
|
||||
class Library extends Model
|
||||
{
|
||||
@@ -11,34 +13,34 @@ class Library extends Model
|
||||
|
||||
/**
|
||||
* The attributes that aren't mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'id' => 'integer',
|
||||
'id' => 'integer',
|
||||
'language_codes' => 'array',
|
||||
];
|
||||
|
||||
protected static function booted()
|
||||
{
|
||||
static::creating(function ($model) {
|
||||
$model->created_by = auth()->id();
|
||||
if (!$model->created_by) {
|
||||
$model->created_by = auth()->id();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function createdBy(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'created_by');
|
||||
}
|
||||
|
||||
public function libraryItems(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function libraryItems(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(LibraryItem::class);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,8 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Spatie\EloquentSortable\Sortable;
|
||||
use Spatie\EloquentSortable\SortableTrait;
|
||||
use Spatie\Image\Manipulations;
|
||||
@@ -40,7 +42,9 @@ class LibraryItem extends Model implements HasMedia, Sortable
|
||||
protected static function booted()
|
||||
{
|
||||
static::creating(function ($model) {
|
||||
$model->created_by = auth()->id();
|
||||
if (!$model->created_by) {
|
||||
$model->created_by = auth()->id();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -68,22 +72,22 @@ class LibraryItem extends Model implements HasMedia, Sortable
|
||||
->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');
|
||||
}
|
||||
|
||||
public function lecturer(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function lecturer(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Lecturer::class);
|
||||
}
|
||||
|
||||
public function episode(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function episode(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Episode::class);
|
||||
}
|
||||
|
||||
public function libraries(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
public function libraries(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Library::class);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Spatie\Image\Manipulations;
|
||||
use Spatie\MediaLibrary\HasMedia;
|
||||
@@ -33,7 +34,9 @@ class Meetup extends Model implements HasMedia
|
||||
protected static function booted()
|
||||
{
|
||||
static::creating(function ($model) {
|
||||
$model->created_by = auth()->id();
|
||||
if (!$model->created_by) {
|
||||
$model->created_by = auth()->id();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -55,12 +58,12 @@ class Meetup extends Model implements HasMedia
|
||||
->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');
|
||||
}
|
||||
|
||||
public function city(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function city(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(City::class);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class MeetupEvent extends Model
|
||||
{
|
||||
@@ -11,35 +12,35 @@ class MeetupEvent extends Model
|
||||
|
||||
/**
|
||||
* The attributes that aren't mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'id' => 'integer',
|
||||
'id' => 'integer',
|
||||
'meetup_id' => 'integer',
|
||||
'start' => 'datetime',
|
||||
'start' => 'datetime',
|
||||
];
|
||||
|
||||
protected static function booted()
|
||||
{
|
||||
static::creating(function ($model) {
|
||||
$model->created_by = auth()->id();
|
||||
if (!$model->created_by) {
|
||||
$model->created_by = auth()->id();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function createdBy(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'created_by');
|
||||
}
|
||||
|
||||
public function meetup(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function meetup(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Meetup::class);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@ class Membership extends JetstreamMembership
|
||||
{
|
||||
/**
|
||||
* Indicates if the IDs are auto-incrementing.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
public $incrementing = true;
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class OrangePill extends Model
|
||||
{
|
||||
@@ -11,29 +12,27 @@ class OrangePill extends Model
|
||||
|
||||
/**
|
||||
* The attributes that aren't mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'id' => 'integer',
|
||||
'user_id' => 'integer',
|
||||
'id' => 'integer',
|
||||
'user_id' => 'integer',
|
||||
'book_case_id' => 'integer',
|
||||
'date' => 'datetime',
|
||||
'date' => 'datetime',
|
||||
];
|
||||
|
||||
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
public function bookCase(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function bookCase(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(BookCase::class);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,6 @@ class Participant extends Model
|
||||
|
||||
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\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class Podcast extends Model
|
||||
@@ -28,11 +29,13 @@ class Podcast extends Model
|
||||
protected static function booted()
|
||||
{
|
||||
static::creating(function ($model) {
|
||||
$model->created_by = auth()->id();
|
||||
if (!$model->created_by) {
|
||||
$model->created_by = auth()->id();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function createdBy(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'created_by');
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
|
||||
class Registration extends Model
|
||||
{
|
||||
@@ -11,29 +12,27 @@ class Registration extends Model
|
||||
|
||||
/**
|
||||
* The attributes that aren't mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'id' => 'integer',
|
||||
'event_id' => 'integer',
|
||||
'id' => 'integer',
|
||||
'event_id' => 'integer',
|
||||
'participant_id' => 'integer',
|
||||
'active' => 'boolean',
|
||||
'active' => 'boolean',
|
||||
];
|
||||
|
||||
public function courseEvent(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function courseEvent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(CourseEvent::class);
|
||||
}
|
||||
|
||||
public function participant(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function participant(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Participant::class);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ class Team extends JetstreamTeam
|
||||
|
||||
/**
|
||||
* The attributes that should be cast.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
@@ -23,7 +22,6 @@ class Team extends JetstreamTeam
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $fillable = [
|
||||
@@ -33,7 +31,6 @@ class Team extends JetstreamTeam
|
||||
|
||||
/**
|
||||
* The event map for the model.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $dispatchesEvents = [
|
||||
|
||||
@@ -9,7 +9,6 @@ class TeamInvitation extends JetstreamTeamInvitation
|
||||
{
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $fillable = [
|
||||
@@ -19,7 +18,6 @@ class TeamInvitation extends JetstreamTeamInvitation
|
||||
|
||||
/**
|
||||
* Get the team that the invitation belongs to.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function team()
|
||||
|
||||
@@ -4,6 +4,8 @@ namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Spatie\Image\Manipulations;
|
||||
use Spatie\MediaLibrary\HasMedia;
|
||||
use Spatie\MediaLibrary\InteractsWithMedia;
|
||||
@@ -37,7 +39,9 @@ class Venue extends Model implements HasMedia
|
||||
protected static function booted()
|
||||
{
|
||||
static::creating(function ($model) {
|
||||
$model->created_by = auth()->id();
|
||||
if (!$model->created_by) {
|
||||
$model->created_by = auth()->id();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -70,12 +74,12 @@ class Venue extends Model implements HasMedia
|
||||
->usingLanguage('de');
|
||||
}
|
||||
|
||||
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function createdBy(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'created_by');
|
||||
}
|
||||
|
||||
public function city(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
public function city(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(City::class);
|
||||
}
|
||||
@@ -90,7 +94,7 @@ class Venue extends Model implements HasMedia
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ use Illuminate\Http\Request;
|
||||
use Laravel\Nova\Fields\HasMany;
|
||||
use Laravel\Nova\Fields\ID;
|
||||
use Laravel\Nova\Fields\MultiSelect;
|
||||
use Laravel\Nova\Fields\Number;
|
||||
use Laravel\Nova\Fields\Text;
|
||||
use Laravel\Nova\Http\Requests\NovaRequest;
|
||||
|
||||
@@ -77,6 +78,16 @@ class Country extends Resource
|
||||
Text::make(__('Code'), 'code')
|
||||
->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),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -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,88 +76,95 @@ class DatabaseSeeder extends Seeder
|
||||
'code' => 'fr',
|
||||
'language_codes' => ['fr'],
|
||||
]);
|
||||
Country::create([
|
||||
'name' => 'Serbia',
|
||||
'code' => 'rs',
|
||||
'language_codes' => ['rs'],
|
||||
'longitude' => 21,
|
||||
'latitude' => 44,
|
||||
]);
|
||||
City::create([
|
||||
'country_id' => 1,
|
||||
'name' => 'Füssen',
|
||||
'latitude' => 47.57143,
|
||||
'longitude' => 10.70171,
|
||||
'created_by' => 1,
|
||||
'created_by' => 1,
|
||||
]);
|
||||
City::create([
|
||||
'country_id' => 1,
|
||||
'name' => 'Kempten',
|
||||
'latitude' => 47.728569,
|
||||
'longitude' => 10.315784,
|
||||
'created_by' => 1,
|
||||
'created_by' => 1,
|
||||
]);
|
||||
City::create([
|
||||
'country_id' => 1,
|
||||
'name' => 'Pfronten',
|
||||
'latitude' => 47.582359,
|
||||
'longitude' => 10.5598,
|
||||
'created_by' => 1,
|
||||
'created_by' => 1,
|
||||
]);
|
||||
City::create([
|
||||
'country_id' => 2,
|
||||
'name' => 'Wien',
|
||||
'latitude' => 48.20835,
|
||||
'longitude' => 16.37250,
|
||||
'created_by' => 1,
|
||||
'created_by' => 1,
|
||||
]);
|
||||
City::create([
|
||||
'country_id' => 3,
|
||||
'name' => 'Zürich',
|
||||
'latitude' => 47.41330,
|
||||
'longitude' => 8.65639,
|
||||
'created_by' => 1,
|
||||
'created_by' => 1,
|
||||
]);
|
||||
Venue::create([
|
||||
'city_id' => 1,
|
||||
'name' => 'The Blue Studio Coworking (Füssen)',
|
||||
'street' => 'Teststraße 1',
|
||||
'created_by' => 1,
|
||||
'city_id' => 1,
|
||||
'name' => 'The Blue Studio Coworking (Füssen)',
|
||||
'street' => 'Teststraße 1',
|
||||
'created_by' => 1,
|
||||
]);
|
||||
Venue::create([
|
||||
'city_id' => 2,
|
||||
'name' => 'The Blue Studio Coworking (Kempten)',
|
||||
'street' => 'Teststraße 2',
|
||||
'created_by' => 1,
|
||||
'city_id' => 2,
|
||||
'name' => 'The Blue Studio Coworking (Kempten)',
|
||||
'street' => 'Teststraße 2',
|
||||
'created_by' => 1,
|
||||
]);
|
||||
Venue::create([
|
||||
'city_id' => 3,
|
||||
'name' => 'The Blue Studio Coworking (Pfronten)',
|
||||
'street' => 'Teststraße 3',
|
||||
'created_by' => 1,
|
||||
'city_id' => 3,
|
||||
'name' => 'The Blue Studio Coworking (Pfronten)',
|
||||
'street' => 'Teststraße 3',
|
||||
'created_by' => 1,
|
||||
]);
|
||||
Venue::create([
|
||||
'city_id' => 4,
|
||||
'name' => 'Innsbruck',
|
||||
'street' => 'Innsbrucker Straße 1',
|
||||
'created_by' => 1,
|
||||
'city_id' => 4,
|
||||
'name' => 'Innsbruck',
|
||||
'street' => 'Innsbrucker Straße 1',
|
||||
'created_by' => 1,
|
||||
]);
|
||||
Lecturer::create([
|
||||
'team_id' => 1,
|
||||
'name' => 'Markus Turm',
|
||||
'active' => true,
|
||||
'created_by' => 1,
|
||||
'team_id' => 1,
|
||||
'name' => 'Markus Turm',
|
||||
'active' => true,
|
||||
'created_by' => 1,
|
||||
]);
|
||||
Lecturer::create([
|
||||
'team_id' => 1,
|
||||
'name' => 'Beppo',
|
||||
'active' => true,
|
||||
'created_by' => 1,
|
||||
'team_id' => 1,
|
||||
'name' => 'Beppo',
|
||||
'active' => true,
|
||||
'created_by' => 1,
|
||||
]);
|
||||
Lecturer::create([
|
||||
'team_id' => 1,
|
||||
'name' => 'Helper',
|
||||
'active' => true,
|
||||
'created_by' => 1,
|
||||
'team_id' => 1,
|
||||
'name' => 'Helper',
|
||||
'active' => true,
|
||||
'created_by' => 1,
|
||||
]);
|
||||
Lecturer::create([
|
||||
'team_id' => 1,
|
||||
'name' => 'Gigi',
|
||||
'active' => true,
|
||||
'created_by' => 1,
|
||||
'team_id' => 1,
|
||||
'name' => 'Gigi',
|
||||
'active' => true,
|
||||
'created_by' => 1,
|
||||
]);
|
||||
$category = Category::create([
|
||||
'name' => 'Präsenzunterricht',
|
||||
@@ -196,56 +203,56 @@ class DatabaseSeeder extends Seeder
|
||||
'last_name' => 'Reher',
|
||||
]);
|
||||
CourseEvent::create([
|
||||
'course_id' => 2,
|
||||
'venue_id' => 1,
|
||||
'link' => 'https://einundzwanzig.space',
|
||||
'from' => now()
|
||||
'course_id' => 2,
|
||||
'venue_id' => 1,
|
||||
'link' => 'https://einundzwanzig.space',
|
||||
'from' => now()
|
||||
->addDays(14)
|
||||
->startOfDay(),
|
||||
'to' => now()
|
||||
'to' => now()
|
||||
->addDays(14)
|
||||
->startOfDay()
|
||||
->addHour(),
|
||||
'created_by' => 1,
|
||||
'created_by' => 1,
|
||||
]);
|
||||
CourseEvent::create([
|
||||
'course_id' => 1,
|
||||
'venue_id' => 2,
|
||||
'link' => 'https://einundzwanzig.space',
|
||||
'from' => now()
|
||||
'course_id' => 1,
|
||||
'venue_id' => 2,
|
||||
'link' => 'https://einundzwanzig.space',
|
||||
'from' => now()
|
||||
->addDays(3)
|
||||
->startOfDay(),
|
||||
'to' => now()
|
||||
'to' => now()
|
||||
->addDays(3)
|
||||
->startOfDay()
|
||||
->addHour(),
|
||||
'created_by' => 1,
|
||||
'created_by' => 1,
|
||||
]);
|
||||
CourseEvent::create([
|
||||
'course_id' => 1,
|
||||
'venue_id' => 3,
|
||||
'link' => 'https://einundzwanzig.space',
|
||||
'from' => now()
|
||||
'course_id' => 1,
|
||||
'venue_id' => 3,
|
||||
'link' => 'https://einundzwanzig.space',
|
||||
'from' => now()
|
||||
->addDays(4)
|
||||
->startOfDay(),
|
||||
'to' => now()
|
||||
'to' => now()
|
||||
->addDays(4)
|
||||
->startOfDay()
|
||||
->addHour(),
|
||||
'created_by' => 1,
|
||||
'created_by' => 1,
|
||||
]);
|
||||
CourseEvent::create([
|
||||
'course_id' => 3,
|
||||
'venue_id' => 3,
|
||||
'link' => 'https://einundzwanzig.space',
|
||||
'from' => now()
|
||||
'course_id' => 3,
|
||||
'venue_id' => 3,
|
||||
'link' => 'https://einundzwanzig.space',
|
||||
'from' => now()
|
||||
->addDays(4)
|
||||
->startOfDay(),
|
||||
'to' => now()
|
||||
'to' => now()
|
||||
->addDays(4)
|
||||
->startOfDay()
|
||||
->addHour(),
|
||||
'created_by' => 1,
|
||||
'created_by' => 1,
|
||||
]);
|
||||
Registration::create([
|
||||
'course_event_id' => 1,
|
||||
@@ -254,7 +261,7 @@ class DatabaseSeeder extends Seeder
|
||||
$library = Library::create([
|
||||
'name' => 'Einundzwanzig',
|
||||
'language_codes' => ['de'],
|
||||
'created_by' => 1,
|
||||
'created_by' => 1,
|
||||
]);
|
||||
$libraryItem = LibraryItem::create([
|
||||
'lecturer_id' => 3,
|
||||
@@ -262,7 +269,7 @@ class DatabaseSeeder extends Seeder
|
||||
'type' => 'youtube_video',
|
||||
'language_code' => 'de',
|
||||
'value' => 'https://www.youtube.com/watch?v=Oztd2Sja4k0',
|
||||
'created_by' => 1,
|
||||
'created_by' => 1,
|
||||
]);
|
||||
$libraryItem->syncTagsWithType(['Bitcoin'], 'library_item');
|
||||
$library->libraryItems()
|
||||
@@ -270,7 +277,7 @@ class DatabaseSeeder extends Seeder
|
||||
$library = Library::create([
|
||||
'name' => 'Apricot',
|
||||
'language_codes' => ['de', 'en'],
|
||||
'created_by' => 1,
|
||||
'created_by' => 1,
|
||||
]);
|
||||
$libraryItem = LibraryItem::create([
|
||||
'lecturer_id' => 4,
|
||||
@@ -278,7 +285,7 @@ class DatabaseSeeder extends Seeder
|
||||
'type' => 'blog_article',
|
||||
'language_code' => 'de',
|
||||
'value' => 'https://aprycot.media/blog/liebe-krypto-und-fiat-bros/',
|
||||
'created_by' => 1,
|
||||
'created_by' => 1,
|
||||
]);
|
||||
$libraryItem->syncTagsWithType(['Bitcoin'], 'library_item');
|
||||
$library->libraryItems()
|
||||
@@ -286,7 +293,7 @@ class DatabaseSeeder extends Seeder
|
||||
$library = Library::create([
|
||||
'name' => 'Gigi',
|
||||
'language_codes' => ['de', 'en'],
|
||||
'created_by' => 1,
|
||||
'created_by' => 1,
|
||||
]);
|
||||
$libraryItem = LibraryItem::create([
|
||||
'lecturer_id' => 4,
|
||||
@@ -294,7 +301,7 @@ class DatabaseSeeder extends Seeder
|
||||
'type' => 'youtube_video',
|
||||
'language_code' => 'de',
|
||||
'value' => 'https://www.youtube.com/watch?v=C7ynm0Zkwfk',
|
||||
'created_by' => 1,
|
||||
'created_by' => 1,
|
||||
]);
|
||||
$libraryItem->syncTagsWithType(['Proof of Work'], 'library_item');
|
||||
$library->libraryItems()
|
||||
@@ -303,7 +310,7 @@ class DatabaseSeeder extends Seeder
|
||||
'name' => 'Einundzwanzig Dozenten',
|
||||
'is_public' => false,
|
||||
'language_codes' => ['de', 'en'],
|
||||
'created_by' => 1,
|
||||
'created_by' => 1,
|
||||
]);
|
||||
$libraryItem = LibraryItem::create([
|
||||
'lecturer_id' => 4,
|
||||
@@ -311,7 +318,7 @@ class DatabaseSeeder extends Seeder
|
||||
'type' => 'downloadable_file',
|
||||
'language_code' => 'de',
|
||||
'value' => null,
|
||||
'created_by' => 1,
|
||||
'created_by' => 1,
|
||||
]);
|
||||
$libraryItem->syncTagsWithType(['Präsentationen'], 'library_item');
|
||||
$nonPublicLibrary->libraryItems()
|
||||
@@ -319,10 +326,10 @@ class DatabaseSeeder extends Seeder
|
||||
Artisan::call(ReadAndSyncEinundzwanzigPodcastFeed::class);
|
||||
Artisan::call(SyncOpenBooks::class);
|
||||
Meetup::create([
|
||||
'city_id' => 1,
|
||||
'name' => 'Einundzwanzig Kempten',
|
||||
'link' => 'https://t.me/EinundzwanzigKempten',
|
||||
'created_by' => 1,
|
||||
'city_id' => 1,
|
||||
'name' => 'Einundzwanzig Kempten',
|
||||
'link' => 'https://t.me/EinundzwanzigKempten',
|
||||
'created_by' => 1,
|
||||
]);
|
||||
MeetupEvent::create([
|
||||
'meetup_id' => 1,
|
||||
|
||||
@@ -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
|
||||
sie auf einem der Meetups kennen. </p>
|
||||
@php
|
||||
$focus = '';
|
||||
$map = $country->code . '_merc';
|
||||
if (!\File::exists(public_path('vendor/jvector/maps/' . $country->code . '.js'))) {
|
||||
$map = 'europe_merc';
|
||||
$focus = 'focusOn: {lat:'.$country->latitude.',lng:'.$country->longitude.',scale:8,animate:true},';
|
||||
}
|
||||
@endphp
|
||||
<div
|
||||
@@ -26,6 +28,7 @@
|
||||
let markers = {{ Js::from($markers) }};
|
||||
|
||||
$('#map').vectorMap({
|
||||
{{ $focus }}
|
||||
zoomButtons : false,
|
||||
zoomOnScroll: true,
|
||||
map: '{{ $map }}',
|
||||
|
||||
Reference in New Issue
Block a user