mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig-portal.git
synced 2025-12-11 06:46:47 +00:00
createdBy fields added
This commit is contained in:
@@ -39,6 +39,7 @@ class ReadAndSyncEinundzwanzigPodcastFeed extends Command
|
|||||||
'link' => $podcast->feed->link,
|
'link' => $podcast->feed->link,
|
||||||
'language_code' => $podcast->feed->language,
|
'language_code' => $podcast->feed->language,
|
||||||
'data' => $podcast->feed,
|
'data' => $podcast->feed,
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
$episodes = $client->episodes->byFeedUrl('https://einundzwanzig.space/feed.xml')
|
$episodes = $client->episodes->byFeedUrl('https://einundzwanzig.space/feed.xml')
|
||||||
->json();
|
->json();
|
||||||
@@ -47,6 +48,7 @@ class ReadAndSyncEinundzwanzigPodcastFeed extends Command
|
|||||||
->updateOrCreate(['guid' => $item->guid], [
|
->updateOrCreate(['guid' => $item->guid], [
|
||||||
'podcast_id' => $einundzwanzigPodcast->id,
|
'podcast_id' => $einundzwanzigPodcast->id,
|
||||||
'data' => $item,
|
'data' => $item,
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ class SyncOpenBooks extends Command
|
|||||||
'deactreason' => $case['deactreason'],
|
'deactreason' => $case['deactreason'],
|
||||||
'entrytype' => $case['entrytype'],
|
'entrytype' => $case['entrytype'],
|
||||||
'homepage' => $case['homepage'],
|
'homepage' => $case['homepage'],
|
||||||
|
'created_by' => 1,
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,6 +51,11 @@ 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
|
||||||
|
{
|
||||||
|
return $this->belongsTo(User::class, 'created_by');
|
||||||
|
}
|
||||||
|
|
||||||
public function venue(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function venue(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Venue::class);
|
return $this->belongsTo(Venue::class);
|
||||||
|
|||||||
@@ -54,6 +54,11 @@ class BookCase extends Model implements HasMedia
|
|||||||
$this->addMediaCollection('images');
|
$this->addMediaCollection('images');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
{
|
||||||
|
return $this->belongsTo(User::class, 'created_by');
|
||||||
|
}
|
||||||
|
|
||||||
public function orangePills(): HasMany
|
public function orangePills(): HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(OrangePill::class);
|
return $this->hasMany(OrangePill::class);
|
||||||
|
|||||||
@@ -40,6 +40,11 @@ class City extends Model
|
|||||||
->usingLanguage('de');
|
->usingLanguage('de');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
{
|
||||||
|
return $this->belongsTo(User::class, 'created_by');
|
||||||
|
}
|
||||||
|
|
||||||
public function country(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function country(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Country::class);
|
return $this->belongsTo(Country::class);
|
||||||
|
|||||||
@@ -54,6 +54,11 @@ 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
|
||||||
|
{
|
||||||
|
return $this->belongsTo(User::class, 'created_by');
|
||||||
|
}
|
||||||
|
|
||||||
public function categories(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
public function categories(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||||
{
|
{
|
||||||
return $this->belongsToMany(Category::class);
|
return $this->belongsToMany(Category::class);
|
||||||
|
|||||||
@@ -29,6 +29,11 @@ class CourseEvent extends Model
|
|||||||
'to' => 'datetime',
|
'to' => 'datetime',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
{
|
||||||
|
return $this->belongsTo(User::class, 'created_by');
|
||||||
|
}
|
||||||
|
|
||||||
public function course(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function course(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Course::class);
|
return $this->belongsTo(Course::class);
|
||||||
|
|||||||
@@ -28,6 +28,11 @@ class Episode extends Model
|
|||||||
'data' => 'array',
|
'data' => 'array',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
{
|
||||||
|
return $this->belongsTo(User::class, 'created_by');
|
||||||
|
}
|
||||||
|
|
||||||
public function podcast(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function podcast(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Podcast::class);
|
return $this->belongsTo(Podcast::class);
|
||||||
|
|||||||
@@ -64,6 +64,11 @@ class Lecturer extends Model implements HasMedia
|
|||||||
->usingLanguage('de');
|
->usingLanguage('de');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
{
|
||||||
|
return $this->belongsTo(User::class, 'created_by');
|
||||||
|
}
|
||||||
|
|
||||||
public function team(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function team(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Team::class);
|
return $this->belongsTo(Team::class);
|
||||||
|
|||||||
@@ -26,6 +26,11 @@ class Library extends Model
|
|||||||
'language_codes' => 'array',
|
'language_codes' => 'array',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
{
|
||||||
|
return $this->belongsTo(User::class, 'created_by');
|
||||||
|
}
|
||||||
|
|
||||||
public function libraryItems(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
public function libraryItems(): \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||||
{
|
{
|
||||||
return $this->belongsToMany(LibraryItem::class);
|
return $this->belongsToMany(LibraryItem::class);
|
||||||
|
|||||||
@@ -59,6 +59,11 @@ 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
|
||||||
|
{
|
||||||
|
return $this->belongsTo(User::class, 'created_by');
|
||||||
|
}
|
||||||
|
|
||||||
public function lecturer(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function lecturer(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Lecturer::class);
|
return $this->belongsTo(Lecturer::class);
|
||||||
|
|||||||
@@ -48,6 +48,11 @@ 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
|
||||||
|
{
|
||||||
|
return $this->belongsTo(User::class, 'created_by');
|
||||||
|
}
|
||||||
|
|
||||||
public function city(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function city(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(City::class);
|
return $this->belongsTo(City::class);
|
||||||
|
|||||||
@@ -27,6 +27,11 @@ class MeetupEvent extends Model
|
|||||||
'start' => 'datetime',
|
'start' => 'datetime',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
{
|
||||||
|
return $this->belongsTo(User::class, 'created_by');
|
||||||
|
}
|
||||||
|
|
||||||
public function meetup(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function meetup(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Meetup::class);
|
return $this->belongsTo(Meetup::class);
|
||||||
|
|||||||
@@ -25,6 +25,11 @@ class Podcast extends Model
|
|||||||
'data' => 'array',
|
'data' => 'array',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
{
|
||||||
|
return $this->belongsTo(User::class, 'created_by');
|
||||||
|
}
|
||||||
|
|
||||||
public function episodes(): HasMany
|
public function episodes(): HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(Episode::class);
|
return $this->hasMany(Episode::class);
|
||||||
|
|||||||
@@ -63,6 +63,11 @@ class Venue extends Model implements HasMedia
|
|||||||
->usingLanguage('de');
|
->usingLanguage('de');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function createdBy(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
{
|
||||||
|
return $this->belongsTo(User::class, 'created_by');
|
||||||
|
}
|
||||||
|
|
||||||
public function city(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function city(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(City::class);
|
return $this->belongsTo(City::class);
|
||||||
|
|||||||
@@ -66,6 +66,8 @@ class BitcoinEvent extends Resource
|
|||||||
|
|
||||||
BelongsTo::make(__('Venue'), 'venue', Venue::class)->searchable(),
|
BelongsTo::make(__('Venue'), 'venue', Venue::class)->searchable(),
|
||||||
|
|
||||||
|
BelongsTo::make(__('Created By'), 'createdBy', User::class),
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Nova;
|
namespace App\Nova;
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use Laravel\Nova\Fields\BelongsTo;
|
||||||
use Laravel\Nova\Fields\Boolean;
|
use Laravel\Nova\Fields\Boolean;
|
||||||
use Laravel\Nova\Fields\HasMany;
|
use Laravel\Nova\Fields\HasMany;
|
||||||
use Laravel\Nova\Fields\ID;
|
use Laravel\Nova\Fields\ID;
|
||||||
@@ -112,6 +113,8 @@ class BookCase extends Resource
|
|||||||
|
|
||||||
MorphMany::make(__('Comments'), 'comments', Comment::class),
|
MorphMany::make(__('Comments'), 'comments', Comment::class),
|
||||||
|
|
||||||
|
BelongsTo::make(__('Created By'), 'createdBy', User::class),
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -75,6 +75,8 @@ class City extends Resource
|
|||||||
|
|
||||||
HasMany::make(__('Meetups'), 'meetups', Meetup::class),
|
HasMany::make(__('Meetups'), 'meetups', Meetup::class),
|
||||||
|
|
||||||
|
BelongsTo::make(__('Created By'), 'createdBy', User::class),
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -98,6 +98,8 @@ class Course extends Resource
|
|||||||
BelongsToMany::make(__('Categories'), 'categories', Category::class)
|
BelongsToMany::make(__('Categories'), 'categories', Category::class)
|
||||||
->onlyOnDetail(),
|
->onlyOnDetail(),
|
||||||
|
|
||||||
|
BelongsTo::make(__('Created By'), 'createdBy', User::class),
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -79,6 +79,8 @@ class CourseEvent extends Resource
|
|||||||
BelongsTo::make(__('Venue'), 'venue', Venue::class)
|
BelongsTo::make(__('Venue'), 'venue', Venue::class)
|
||||||
->searchable(),
|
->searchable(),
|
||||||
|
|
||||||
|
BelongsTo::make(__('Created By'), 'createdBy', User::class),
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,6 @@ class Episode extends Resource
|
|||||||
'language_code' => $model->podcast->language_code,
|
'language_code' => $model->podcast->language_code,
|
||||||
'value' => null,
|
'value' => null,
|
||||||
]);
|
]);
|
||||||
ray($request->tags);
|
|
||||||
$libraryItem->syncTagsWithType(is_array($request->tags) ? $request->tags : str($request->tags)->explode('-----'),
|
$libraryItem->syncTagsWithType(is_array($request->tags) ? $request->tags : str($request->tags)->explode('-----'),
|
||||||
'library_item');
|
'library_item');
|
||||||
$libraryItem->addMediaFromUrl($model->data['image'])
|
$libraryItem->addMediaFromUrl($model->data['image'])
|
||||||
@@ -103,6 +102,8 @@ class Episode extends Resource
|
|||||||
BelongsTo::make(__('Podcast'), 'podcast', Podcast::class)
|
BelongsTo::make(__('Podcast'), 'podcast', Podcast::class)
|
||||||
->readonly(),
|
->readonly(),
|
||||||
|
|
||||||
|
BelongsTo::make(__('Created By'), 'createdBy', User::class),
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -86,6 +86,8 @@ class Lecturer extends Resource
|
|||||||
|
|
||||||
BelongsTo::make('Team'),
|
BelongsTo::make('Team'),
|
||||||
|
|
||||||
|
BelongsTo::make(__('Created By'), 'createdBy', User::class),
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
namespace App\Nova;
|
namespace App\Nova;
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use Laravel\Nova\Fields\BelongsTo;
|
||||||
use Laravel\Nova\Fields\BelongsToMany;
|
use Laravel\Nova\Fields\BelongsToMany;
|
||||||
use Laravel\Nova\Fields\Boolean;
|
use Laravel\Nova\Fields\Boolean;
|
||||||
use Laravel\Nova\Fields\ID;
|
use Laravel\Nova\Fields\ID;
|
||||||
@@ -62,6 +63,9 @@ class Library extends Resource
|
|||||||
),
|
),
|
||||||
|
|
||||||
BelongsToMany::make('Library Items'),
|
BelongsToMany::make('Library Items'),
|
||||||
|
|
||||||
|
BelongsTo::make(__('Created By'), 'createdBy', User::class),
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -95,6 +95,8 @@ class LibraryItem extends Resource
|
|||||||
|
|
||||||
BelongsToMany::make(__('Library'), 'libraries', Library::class),
|
BelongsToMany::make(__('Library'), 'libraries', Library::class),
|
||||||
|
|
||||||
|
BelongsTo::make(__('Created By'), 'createdBy', User::class),
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -56,6 +56,8 @@ class Meetup extends Resource
|
|||||||
|
|
||||||
BelongsTo::make(__('City'), 'city', City::class)->searchable(),
|
BelongsTo::make(__('City'), 'city', City::class)->searchable(),
|
||||||
|
|
||||||
|
BelongsTo::make(__('Created By'), 'createdBy', User::class),
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,8 @@ class MeetupEvent extends Resource
|
|||||||
BelongsTo::make('Meetup')
|
BelongsTo::make('Meetup')
|
||||||
->searchable(),
|
->searchable(),
|
||||||
|
|
||||||
|
BelongsTo::make(__('Created By'), 'createdBy', User::class),
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ namespace App\Nova;
|
|||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Laravel\Nova\Fields\Avatar;
|
use Laravel\Nova\Fields\Avatar;
|
||||||
|
use Laravel\Nova\Fields\BelongsTo;
|
||||||
use Laravel\Nova\Fields\Boolean;
|
use Laravel\Nova\Fields\Boolean;
|
||||||
use Laravel\Nova\Fields\Code;
|
use Laravel\Nova\Fields\Code;
|
||||||
use Laravel\Nova\Fields\HasMany;
|
use Laravel\Nova\Fields\HasMany;
|
||||||
@@ -80,6 +81,9 @@ class Podcast extends Resource
|
|||||||
->json(),
|
->json(),
|
||||||
|
|
||||||
HasMany::make(__('Episodes'), 'episodes', Episode::class),
|
HasMany::make(__('Episodes'), 'episodes', Episode::class),
|
||||||
|
|
||||||
|
BelongsTo::make(__('Created By'), 'createdBy', User::class),
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,8 @@ class Venue extends Resource
|
|||||||
|
|
||||||
BelongsTo::make(__('City'), 'city', City::class),
|
BelongsTo::make(__('City'), 'city', City::class),
|
||||||
|
|
||||||
|
BelongsTo::make(__('Created By'), 'createdBy', User::class),
|
||||||
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class BasePolicy
|
|||||||
*/
|
*/
|
||||||
public function before(User $user, $ability)
|
public function before(User $user, $ability)
|
||||||
{
|
{
|
||||||
if ($user->hasRole('super-admin') || app()->environment('local')) {
|
if ($user->hasRole('super-admin') || config('app.super-admin')) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
101
app/Policies/BitcoinEventPolicy.php
Normal file
101
app/Policies/BitcoinEventPolicy.php
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Policies;
|
||||||
|
|
||||||
|
use App\Models\BitcoinEvent;
|
||||||
|
use App\Models\User;
|
||||||
|
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||||
|
|
||||||
|
class BitcoinEventPolicy extends BasePolicy
|
||||||
|
{
|
||||||
|
use HandlesAuthorization;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the user can view any models.
|
||||||
|
*
|
||||||
|
* @param \App\Models\User $user
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Auth\Access\Response|bool
|
||||||
|
*/
|
||||||
|
public function viewAny(User $user)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the user can view the model.
|
||||||
|
*
|
||||||
|
* @param \App\Models\User $user
|
||||||
|
* @param \App\Models\BitcoinEvent $bitcoinEvent
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Auth\Access\Response|bool
|
||||||
|
*/
|
||||||
|
public function view(User $user, BitcoinEvent $bitcoinEvent)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the user can create models.
|
||||||
|
*
|
||||||
|
* @param \App\Models\User $user
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Auth\Access\Response|bool
|
||||||
|
*/
|
||||||
|
public function create(User $user)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the user can update the model.
|
||||||
|
*
|
||||||
|
* @param \App\Models\User $user
|
||||||
|
* @param \App\Models\BitcoinEvent $bitcoinEvent
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Auth\Access\Response|bool
|
||||||
|
*/
|
||||||
|
public function update(User $user, BitcoinEvent $bitcoinEvent)
|
||||||
|
{
|
||||||
|
return $bitcoinEvent->created_by === $user->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the user can delete the model.
|
||||||
|
*
|
||||||
|
* @param \App\Models\User $user
|
||||||
|
* @param \App\Models\BitcoinEvent $bitcoinEvent
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Auth\Access\Response|bool
|
||||||
|
*/
|
||||||
|
public function delete(User $user, BitcoinEvent $bitcoinEvent)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the user can restore the model.
|
||||||
|
*
|
||||||
|
* @param \App\Models\User $user
|
||||||
|
* @param \App\Models\BitcoinEvent $bitcoinEvent
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Auth\Access\Response|bool
|
||||||
|
*/
|
||||||
|
public function restore(User $user, BitcoinEvent $bitcoinEvent)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determine whether the user can permanently delete the model.
|
||||||
|
*
|
||||||
|
* @param \App\Models\User $user
|
||||||
|
* @param \App\Models\BitcoinEvent $bitcoinEvent
|
||||||
|
*
|
||||||
|
* @return \Illuminate\Auth\Access\Response|bool
|
||||||
|
*/
|
||||||
|
public function forceDelete(User $user, BitcoinEvent $bitcoinEvent)
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -53,7 +53,7 @@ class CityPolicy extends BasePolicy
|
|||||||
*/
|
*/
|
||||||
public function update(User $user, City $city)
|
public function update(User $user, City $city)
|
||||||
{
|
{
|
||||||
return $user->is_lecturer;
|
return $city->created_by === $user->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ class LecturerPolicy extends BasePolicy
|
|||||||
*/
|
*/
|
||||||
public function update(User $user, Lecturer $lecturer)
|
public function update(User $user, Lecturer $lecturer)
|
||||||
{
|
{
|
||||||
return $user->belongsToTeam($lecturer->team);
|
return $lecturer->created_by === $user->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class LibraryItemPolicy extends BasePolicy
|
|||||||
*/
|
*/
|
||||||
public function update(User $user, LibraryItem $libraryItem)
|
public function update(User $user, LibraryItem $libraryItem)
|
||||||
{
|
{
|
||||||
return false;
|
return $libraryItem->created_by === $user->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class LibraryPolicy extends BasePolicy
|
|||||||
*/
|
*/
|
||||||
public function update(User $user, Library $library)
|
public function update(User $user, Library $library)
|
||||||
{
|
{
|
||||||
return false;
|
return $library->created_by === $user->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class MeetupEventPolicy extends BasePolicy
|
|||||||
*/
|
*/
|
||||||
public function update(User $user, MeetupEvent $meetupEvent)
|
public function update(User $user, MeetupEvent $meetupEvent)
|
||||||
{
|
{
|
||||||
return false;
|
return $meetupEvent->created_by === $user->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ class MeetupPolicy extends BasePolicy
|
|||||||
*/
|
*/
|
||||||
public function update(User $user, Meetup $meetup)
|
public function update(User $user, Meetup $meetup)
|
||||||
{
|
{
|
||||||
return false;
|
return $meetup->created_by === $user->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ class OrangePillPolicy extends BasePolicy
|
|||||||
* Determine whether the user can view any models.
|
* Determine whether the user can view any models.
|
||||||
*
|
*
|
||||||
* @param \App\Models\User $user
|
* @param \App\Models\User $user
|
||||||
|
*
|
||||||
* @return \Illuminate\Auth\Access\Response|bool
|
* @return \Illuminate\Auth\Access\Response|bool
|
||||||
*/
|
*/
|
||||||
public function viewAny(User $user)
|
public function viewAny(User $user)
|
||||||
@@ -26,6 +27,7 @@ class OrangePillPolicy extends BasePolicy
|
|||||||
*
|
*
|
||||||
* @param \App\Models\User $user
|
* @param \App\Models\User $user
|
||||||
* @param \App\Models\OrangePill $orangePill
|
* @param \App\Models\OrangePill $orangePill
|
||||||
|
*
|
||||||
* @return \Illuminate\Auth\Access\Response|bool
|
* @return \Illuminate\Auth\Access\Response|bool
|
||||||
*/
|
*/
|
||||||
public function view(User $user, OrangePill $orangePill)
|
public function view(User $user, OrangePill $orangePill)
|
||||||
@@ -37,6 +39,7 @@ class OrangePillPolicy extends BasePolicy
|
|||||||
* Determine whether the user can create models.
|
* Determine whether the user can create models.
|
||||||
*
|
*
|
||||||
* @param \App\Models\User $user
|
* @param \App\Models\User $user
|
||||||
|
*
|
||||||
* @return \Illuminate\Auth\Access\Response|bool
|
* @return \Illuminate\Auth\Access\Response|bool
|
||||||
*/
|
*/
|
||||||
public function create(User $user)
|
public function create(User $user)
|
||||||
@@ -49,11 +52,12 @@ class OrangePillPolicy extends BasePolicy
|
|||||||
*
|
*
|
||||||
* @param \App\Models\User $user
|
* @param \App\Models\User $user
|
||||||
* @param \App\Models\OrangePill $orangePill
|
* @param \App\Models\OrangePill $orangePill
|
||||||
|
*
|
||||||
* @return \Illuminate\Auth\Access\Response|bool
|
* @return \Illuminate\Auth\Access\Response|bool
|
||||||
*/
|
*/
|
||||||
public function update(User $user, OrangePill $orangePill)
|
public function update(User $user, OrangePill $orangePill)
|
||||||
{
|
{
|
||||||
return false;
|
return $orangePill->user_id === $user->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -61,6 +65,7 @@ class OrangePillPolicy extends BasePolicy
|
|||||||
*
|
*
|
||||||
* @param \App\Models\User $user
|
* @param \App\Models\User $user
|
||||||
* @param \App\Models\OrangePill $orangePill
|
* @param \App\Models\OrangePill $orangePill
|
||||||
|
*
|
||||||
* @return \Illuminate\Auth\Access\Response|bool
|
* @return \Illuminate\Auth\Access\Response|bool
|
||||||
*/
|
*/
|
||||||
public function delete(User $user, OrangePill $orangePill)
|
public function delete(User $user, OrangePill $orangePill)
|
||||||
@@ -73,6 +78,7 @@ class OrangePillPolicy extends BasePolicy
|
|||||||
*
|
*
|
||||||
* @param \App\Models\User $user
|
* @param \App\Models\User $user
|
||||||
* @param \App\Models\OrangePill $orangePill
|
* @param \App\Models\OrangePill $orangePill
|
||||||
|
*
|
||||||
* @return \Illuminate\Auth\Access\Response|bool
|
* @return \Illuminate\Auth\Access\Response|bool
|
||||||
*/
|
*/
|
||||||
public function restore(User $user, OrangePill $orangePill)
|
public function restore(User $user, OrangePill $orangePill)
|
||||||
@@ -85,6 +91,7 @@ class OrangePillPolicy extends BasePolicy
|
|||||||
*
|
*
|
||||||
* @param \App\Models\User $user
|
* @param \App\Models\User $user
|
||||||
* @param \App\Models\OrangePill $orangePill
|
* @param \App\Models\OrangePill $orangePill
|
||||||
|
*
|
||||||
* @return \Illuminate\Auth\Access\Response|bool
|
* @return \Illuminate\Auth\Access\Response|bool
|
||||||
*/
|
*/
|
||||||
public function forceDelete(User $user, OrangePill $orangePill)
|
public function forceDelete(User $user, OrangePill $orangePill)
|
||||||
|
|||||||
@@ -57,8 +57,7 @@ class VenuePolicy extends BasePolicy
|
|||||||
*/
|
*/
|
||||||
public function update(User $user, Venue $venue)
|
public function update(User $user, Venue $venue)
|
||||||
{
|
{
|
||||||
return $venue->lecturers->where('team_id', $user->current_team_id)
|
return $venue->created_by === $user->id;
|
||||||
->isNotEmpty();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
22
composer.lock
generated
22
composer.lock
generated
@@ -13011,16 +13011,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "laravel-lang/lang",
|
"name": "laravel-lang/lang",
|
||||||
"version": "12.7.0",
|
"version": "12.7.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/Laravel-Lang/lang.git",
|
"url": "https://github.com/Laravel-Lang/lang.git",
|
||||||
"reference": "d900bc6dc001a8ca63cc13184c0720d4262e0d23"
|
"reference": "839ce5d81cd4a8deda5c09bb74af995371345c5b"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/Laravel-Lang/lang/zipball/d900bc6dc001a8ca63cc13184c0720d4262e0d23",
|
"url": "https://api.github.com/repos/Laravel-Lang/lang/zipball/839ce5d81cd4a8deda5c09bb74af995371345c5b",
|
||||||
"reference": "d900bc6dc001a8ca63cc13184c0720d4262e0d23",
|
"reference": "839ce5d81cd4a8deda5c09bb74af995371345c5b",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -13082,7 +13082,7 @@
|
|||||||
"type": "open_collective"
|
"type": "open_collective"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-12-14T07:53:56+00:00"
|
"time": "2022-12-14T13:47:21+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "laravel-lang/publisher",
|
"name": "laravel-lang/publisher",
|
||||||
@@ -13820,16 +13820,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpunit/php-code-coverage",
|
"name": "phpunit/php-code-coverage",
|
||||||
"version": "9.2.20",
|
"version": "9.2.21",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
|
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
|
||||||
"reference": "af7463c955007de36db0c5e26d03e2f933c2e980"
|
"reference": "3f893e19712bb0c8bc86665d1562e9fd509c4ef0"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/af7463c955007de36db0c5e26d03e2f933c2e980",
|
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/3f893e19712bb0c8bc86665d1562e9fd509c4ef0",
|
||||||
"reference": "af7463c955007de36db0c5e26d03e2f933c2e980",
|
"reference": "3f893e19712bb0c8bc86665d1562e9fd509c4ef0",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -13885,7 +13885,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
|
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
|
||||||
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.20"
|
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.21"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -13893,7 +13893,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-12-13T07:49:28+00:00"
|
"time": "2022-12-14T13:26:54+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpunit/php-file-iterator",
|
"name": "phpunit/php-file-iterator",
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ use Illuminate\Support\Facades\Facade;
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
|
'super-admin' => env('SUPERADMIN', false),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Application Name
|
| Application Name
|
||||||
|
|||||||
@@ -0,0 +1,117 @@
|
|||||||
|
<?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('cities', function (Blueprint $table) {
|
||||||
|
$table->foreignId('created_by')
|
||||||
|
->default(1)
|
||||||
|
->constrained('users')
|
||||||
|
->cascadeOnDelete()
|
||||||
|
->cascadeOnUpdate();
|
||||||
|
});
|
||||||
|
Schema::table('venues', function (Blueprint $table) {
|
||||||
|
$table->foreignId('created_by')
|
||||||
|
->default(1)
|
||||||
|
->constrained('users')
|
||||||
|
->cascadeOnDelete()
|
||||||
|
->cascadeOnUpdate();
|
||||||
|
});
|
||||||
|
Schema::table('lecturers', function (Blueprint $table) {
|
||||||
|
$table->foreignId('created_by')
|
||||||
|
->default(1)
|
||||||
|
->constrained('users')
|
||||||
|
->cascadeOnDelete()
|
||||||
|
->cascadeOnUpdate();
|
||||||
|
});
|
||||||
|
Schema::table('meetups', function (Blueprint $table) {
|
||||||
|
$table->foreignId('created_by')
|
||||||
|
->default(1)
|
||||||
|
->constrained('users')
|
||||||
|
->cascadeOnDelete()
|
||||||
|
->cascadeOnUpdate();
|
||||||
|
});
|
||||||
|
Schema::table('meetup_events', function (Blueprint $table) {
|
||||||
|
$table->foreignId('created_by')
|
||||||
|
->default(1)
|
||||||
|
->constrained('users')
|
||||||
|
->cascadeOnDelete()
|
||||||
|
->cascadeOnUpdate();
|
||||||
|
});
|
||||||
|
Schema::table('bitcoin_events', function (Blueprint $table) {
|
||||||
|
$table->foreignId('created_by')
|
||||||
|
->default(1)
|
||||||
|
->constrained('users')
|
||||||
|
->cascadeOnDelete()
|
||||||
|
->cascadeOnUpdate();
|
||||||
|
});
|
||||||
|
Schema::table('courses', function (Blueprint $table) {
|
||||||
|
$table->foreignId('created_by')
|
||||||
|
->default(1)
|
||||||
|
->constrained('users')
|
||||||
|
->cascadeOnDelete()
|
||||||
|
->cascadeOnUpdate();
|
||||||
|
});
|
||||||
|
Schema::table('course_events', function (Blueprint $table) {
|
||||||
|
$table->foreignId('created_by')
|
||||||
|
->default(1)
|
||||||
|
->constrained('users')
|
||||||
|
->cascadeOnDelete()
|
||||||
|
->cascadeOnUpdate();
|
||||||
|
});
|
||||||
|
Schema::table('libraries', function (Blueprint $table) {
|
||||||
|
$table->foreignId('created_by')
|
||||||
|
->default(1)
|
||||||
|
->constrained('users')
|
||||||
|
->cascadeOnDelete()
|
||||||
|
->cascadeOnUpdate();
|
||||||
|
});
|
||||||
|
Schema::table('library_items', function (Blueprint $table) {
|
||||||
|
$table->foreignId('created_by')
|
||||||
|
->default(1)
|
||||||
|
->constrained('users')
|
||||||
|
->cascadeOnDelete()
|
||||||
|
->cascadeOnUpdate();
|
||||||
|
});
|
||||||
|
Schema::table('podcasts', function (Blueprint $table) {
|
||||||
|
$table->foreignId('created_by')
|
||||||
|
->default(1)
|
||||||
|
->constrained('users')
|
||||||
|
->cascadeOnDelete()
|
||||||
|
->cascadeOnUpdate();
|
||||||
|
});
|
||||||
|
Schema::table('episodes', function (Blueprint $table) {
|
||||||
|
$table->foreignId('created_by')
|
||||||
|
->default(1)
|
||||||
|
->constrained('users')
|
||||||
|
->cascadeOnDelete()
|
||||||
|
->cascadeOnUpdate();
|
||||||
|
});
|
||||||
|
Schema::table('book_cases', function (Blueprint $table) {
|
||||||
|
$table->foreignId('created_by')
|
||||||
|
->default(1)
|
||||||
|
->constrained('users')
|
||||||
|
->cascadeOnDelete()
|
||||||
|
->cascadeOnUpdate();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('cities', function (Blueprint $table) {
|
||||||
|
//
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -81,70 +81,83 @@ class DatabaseSeeder extends Seeder
|
|||||||
'name' => 'Füssen',
|
'name' => 'Füssen',
|
||||||
'latitude' => 47.57143,
|
'latitude' => 47.57143,
|
||||||
'longitude' => 10.70171,
|
'longitude' => 10.70171,
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
City::create([
|
City::create([
|
||||||
'country_id' => 1,
|
'country_id' => 1,
|
||||||
'name' => 'Kempten',
|
'name' => 'Kempten',
|
||||||
'latitude' => 47.728569,
|
'latitude' => 47.728569,
|
||||||
'longitude' => 10.315784,
|
'longitude' => 10.315784,
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
City::create([
|
City::create([
|
||||||
'country_id' => 1,
|
'country_id' => 1,
|
||||||
'name' => 'Pfronten',
|
'name' => 'Pfronten',
|
||||||
'latitude' => 47.582359,
|
'latitude' => 47.582359,
|
||||||
'longitude' => 10.5598,
|
'longitude' => 10.5598,
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
City::create([
|
City::create([
|
||||||
'country_id' => 2,
|
'country_id' => 2,
|
||||||
'name' => 'Wien',
|
'name' => 'Wien',
|
||||||
'latitude' => 48.20835,
|
'latitude' => 48.20835,
|
||||||
'longitude' => 16.37250,
|
'longitude' => 16.37250,
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
City::create([
|
City::create([
|
||||||
'country_id' => 3,
|
'country_id' => 3,
|
||||||
'name' => 'Zürich',
|
'name' => 'Zürich',
|
||||||
'latitude' => 47.41330,
|
'latitude' => 47.41330,
|
||||||
'longitude' => 8.65639,
|
'longitude' => 8.65639,
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
Venue::create([
|
Venue::create([
|
||||||
'city_id' => 1,
|
'city_id' => 1,
|
||||||
'name' => 'The Blue Studio Coworking (Füssen)',
|
'name' => 'The Blue Studio Coworking (Füssen)',
|
||||||
'street' => 'Teststraße 1',
|
'street' => 'Teststraße 1',
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
Venue::create([
|
Venue::create([
|
||||||
'city_id' => 2,
|
'city_id' => 2,
|
||||||
'name' => 'The Blue Studio Coworking (Kempten)',
|
'name' => 'The Blue Studio Coworking (Kempten)',
|
||||||
'street' => 'Teststraße 2',
|
'street' => 'Teststraße 2',
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
Venue::create([
|
Venue::create([
|
||||||
'city_id' => 3,
|
'city_id' => 3,
|
||||||
'name' => 'The Blue Studio Coworking (Pfronten)',
|
'name' => 'The Blue Studio Coworking (Pfronten)',
|
||||||
'street' => 'Teststraße 3',
|
'street' => 'Teststraße 3',
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
Venue::create([
|
Venue::create([
|
||||||
'city_id' => 4,
|
'city_id' => 4,
|
||||||
'name' => 'Innsbruck',
|
'name' => 'Innsbruck',
|
||||||
'street' => 'Innsbrucker Straße 1',
|
'street' => 'Innsbrucker Straße 1',
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
Lecturer::create([
|
Lecturer::create([
|
||||||
'team_id' => 1,
|
'team_id' => 1,
|
||||||
'name' => 'Markus Turm',
|
'name' => 'Markus Turm',
|
||||||
'active' => true,
|
'active' => true,
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
Lecturer::create([
|
Lecturer::create([
|
||||||
'team_id' => 1,
|
'team_id' => 1,
|
||||||
'name' => 'Beppo',
|
'name' => 'Beppo',
|
||||||
'active' => true,
|
'active' => true,
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
Lecturer::create([
|
Lecturer::create([
|
||||||
'team_id' => 1,
|
'team_id' => 1,
|
||||||
'name' => 'Helper',
|
'name' => 'Helper',
|
||||||
'active' => true,
|
'active' => true,
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
Lecturer::create([
|
Lecturer::create([
|
||||||
'team_id' => 1,
|
'team_id' => 1,
|
||||||
'name' => 'Gigi',
|
'name' => 'Gigi',
|
||||||
'active' => true,
|
'active' => true,
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
$category = Category::create([
|
$category = Category::create([
|
||||||
'name' => 'Präsenzunterricht',
|
'name' => 'Präsenzunterricht',
|
||||||
@@ -157,6 +170,7 @@ class DatabaseSeeder extends Seeder
|
|||||||
$course = Course::create([
|
$course = Course::create([
|
||||||
'lecturer_id' => 1,
|
'lecturer_id' => 1,
|
||||||
'name' => 'Hands on Bitcoin',
|
'name' => 'Hands on Bitcoin',
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
$course->syncTagsWithType(['Hardware Wallet'], 'course');
|
$course->syncTagsWithType(['Hardware Wallet'], 'course');
|
||||||
$course->categories()
|
$course->categories()
|
||||||
@@ -164,6 +178,7 @@ class DatabaseSeeder extends Seeder
|
|||||||
$course = Course::create([
|
$course = Course::create([
|
||||||
'lecturer_id' => 1,
|
'lecturer_id' => 1,
|
||||||
'name' => 'Bitcoin <> Crypto',
|
'name' => 'Bitcoin <> Crypto',
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
$course->syncTagsWithType(['Lightning'], 'course');
|
$course->syncTagsWithType(['Lightning'], 'course');
|
||||||
$course->categories()
|
$course->categories()
|
||||||
@@ -171,6 +186,7 @@ class DatabaseSeeder extends Seeder
|
|||||||
$course = Course::create([
|
$course = Course::create([
|
||||||
'lecturer_id' => 2,
|
'lecturer_id' => 2,
|
||||||
'name' => 'Bitcoin Lightning Network',
|
'name' => 'Bitcoin Lightning Network',
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
$course->syncTagsWithType(['Für Unternehmen'], 'course');
|
$course->syncTagsWithType(['Für Unternehmen'], 'course');
|
||||||
$course->categories()
|
$course->categories()
|
||||||
@@ -190,6 +206,7 @@ class DatabaseSeeder extends Seeder
|
|||||||
->addDays(14)
|
->addDays(14)
|
||||||
->startOfDay()
|
->startOfDay()
|
||||||
->addHour(),
|
->addHour(),
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
CourseEvent::create([
|
CourseEvent::create([
|
||||||
'course_id' => 1,
|
'course_id' => 1,
|
||||||
@@ -202,6 +219,7 @@ class DatabaseSeeder extends Seeder
|
|||||||
->addDays(3)
|
->addDays(3)
|
||||||
->startOfDay()
|
->startOfDay()
|
||||||
->addHour(),
|
->addHour(),
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
CourseEvent::create([
|
CourseEvent::create([
|
||||||
'course_id' => 1,
|
'course_id' => 1,
|
||||||
@@ -214,6 +232,7 @@ class DatabaseSeeder extends Seeder
|
|||||||
->addDays(4)
|
->addDays(4)
|
||||||
->startOfDay()
|
->startOfDay()
|
||||||
->addHour(),
|
->addHour(),
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
CourseEvent::create([
|
CourseEvent::create([
|
||||||
'course_id' => 3,
|
'course_id' => 3,
|
||||||
@@ -226,6 +245,7 @@ class DatabaseSeeder extends Seeder
|
|||||||
->addDays(4)
|
->addDays(4)
|
||||||
->startOfDay()
|
->startOfDay()
|
||||||
->addHour(),
|
->addHour(),
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
Registration::create([
|
Registration::create([
|
||||||
'course_event_id' => 1,
|
'course_event_id' => 1,
|
||||||
@@ -234,6 +254,7 @@ class DatabaseSeeder extends Seeder
|
|||||||
$library = Library::create([
|
$library = Library::create([
|
||||||
'name' => 'Einundzwanzig',
|
'name' => 'Einundzwanzig',
|
||||||
'language_codes' => ['de'],
|
'language_codes' => ['de'],
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
$libraryItem = LibraryItem::create([
|
$libraryItem = LibraryItem::create([
|
||||||
'lecturer_id' => 3,
|
'lecturer_id' => 3,
|
||||||
@@ -241,6 +262,7 @@ class DatabaseSeeder extends Seeder
|
|||||||
'type' => 'youtube_video',
|
'type' => 'youtube_video',
|
||||||
'language_code' => 'de',
|
'language_code' => 'de',
|
||||||
'value' => 'https://www.youtube.com/watch?v=Oztd2Sja4k0',
|
'value' => 'https://www.youtube.com/watch?v=Oztd2Sja4k0',
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
$libraryItem->syncTagsWithType(['Bitcoin'], 'library_item');
|
$libraryItem->syncTagsWithType(['Bitcoin'], 'library_item');
|
||||||
$library->libraryItems()
|
$library->libraryItems()
|
||||||
@@ -248,6 +270,7 @@ class DatabaseSeeder extends Seeder
|
|||||||
$library = Library::create([
|
$library = Library::create([
|
||||||
'name' => 'Apricot',
|
'name' => 'Apricot',
|
||||||
'language_codes' => ['de', 'en'],
|
'language_codes' => ['de', 'en'],
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
$libraryItem = LibraryItem::create([
|
$libraryItem = LibraryItem::create([
|
||||||
'lecturer_id' => 4,
|
'lecturer_id' => 4,
|
||||||
@@ -255,6 +278,7 @@ class DatabaseSeeder extends Seeder
|
|||||||
'type' => 'blog_article',
|
'type' => 'blog_article',
|
||||||
'language_code' => 'de',
|
'language_code' => 'de',
|
||||||
'value' => 'https://aprycot.media/blog/liebe-krypto-und-fiat-bros/',
|
'value' => 'https://aprycot.media/blog/liebe-krypto-und-fiat-bros/',
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
$libraryItem->syncTagsWithType(['Bitcoin'], 'library_item');
|
$libraryItem->syncTagsWithType(['Bitcoin'], 'library_item');
|
||||||
$library->libraryItems()
|
$library->libraryItems()
|
||||||
@@ -262,6 +286,7 @@ class DatabaseSeeder extends Seeder
|
|||||||
$library = Library::create([
|
$library = Library::create([
|
||||||
'name' => 'Gigi',
|
'name' => 'Gigi',
|
||||||
'language_codes' => ['de', 'en'],
|
'language_codes' => ['de', 'en'],
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
$libraryItem = LibraryItem::create([
|
$libraryItem = LibraryItem::create([
|
||||||
'lecturer_id' => 4,
|
'lecturer_id' => 4,
|
||||||
@@ -269,6 +294,7 @@ class DatabaseSeeder extends Seeder
|
|||||||
'type' => 'youtube_video',
|
'type' => 'youtube_video',
|
||||||
'language_code' => 'de',
|
'language_code' => 'de',
|
||||||
'value' => 'https://www.youtube.com/watch?v=C7ynm0Zkwfk',
|
'value' => 'https://www.youtube.com/watch?v=C7ynm0Zkwfk',
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
$libraryItem->syncTagsWithType(['Proof of Work'], 'library_item');
|
$libraryItem->syncTagsWithType(['Proof of Work'], 'library_item');
|
||||||
$library->libraryItems()
|
$library->libraryItems()
|
||||||
@@ -277,6 +303,7 @@ class DatabaseSeeder extends Seeder
|
|||||||
'name' => 'Einundzwanzig Dozenten',
|
'name' => 'Einundzwanzig Dozenten',
|
||||||
'is_public' => false,
|
'is_public' => false,
|
||||||
'language_codes' => ['de', 'en'],
|
'language_codes' => ['de', 'en'],
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
$libraryItem = LibraryItem::create([
|
$libraryItem = LibraryItem::create([
|
||||||
'lecturer_id' => 4,
|
'lecturer_id' => 4,
|
||||||
@@ -284,6 +311,7 @@ class DatabaseSeeder extends Seeder
|
|||||||
'type' => 'downloadable_file',
|
'type' => 'downloadable_file',
|
||||||
'language_code' => 'de',
|
'language_code' => 'de',
|
||||||
'value' => null,
|
'value' => null,
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
$libraryItem->syncTagsWithType(['Präsentationen'], 'library_item');
|
$libraryItem->syncTagsWithType(['Präsentationen'], 'library_item');
|
||||||
$nonPublicLibrary->libraryItems()
|
$nonPublicLibrary->libraryItems()
|
||||||
@@ -294,6 +322,7 @@ class DatabaseSeeder extends Seeder
|
|||||||
'city_id' => 1,
|
'city_id' => 1,
|
||||||
'name' => 'Einundzwanzig Kempten',
|
'name' => 'Einundzwanzig Kempten',
|
||||||
'link' => 'https://t.me/EinundzwanzigKempten',
|
'link' => 'https://t.me/EinundzwanzigKempten',
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
MeetupEvent::create([
|
MeetupEvent::create([
|
||||||
'meetup_id' => 1,
|
'meetup_id' => 1,
|
||||||
@@ -304,6 +333,7 @@ class DatabaseSeeder extends Seeder
|
|||||||
'location' => 'Einundzwanzig Kempten',
|
'location' => 'Einundzwanzig Kempten',
|
||||||
'description' => fake()->text(),
|
'description' => fake()->text(),
|
||||||
'link' => 'https://t.me/EinundzwanzigKempten',
|
'link' => 'https://t.me/EinundzwanzigKempten',
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
BitcoinEvent::create([
|
BitcoinEvent::create([
|
||||||
'venue_id' => 4,
|
'venue_id' => 4,
|
||||||
@@ -321,6 +351,7 @@ Advance ticket sales begin on December 21, 2022 at 9:21 p.m. with time-limited e
|
|||||||
Ticket presale begins on December 21, 2022 at 9:21 p.m. Be quick - there are a limited amount of early bird tickets again.
|
Ticket presale begins on December 21, 2022 at 9:21 p.m. Be quick - there are a limited amount of early bird tickets again.
|
||||||
',
|
',
|
||||||
'link' => 'https://bconf.de/en/',
|
'link' => 'https://bconf.de/en/',
|
||||||
|
'created_by' => 1,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
models:
|
||||||
|
Item:
|
||||||
|
name: string:unique
|
||||||
|
link: string
|
||||||
|
|||||||
Reference in New Issue
Block a user