for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace App;
class Team extends \Xoco70\LaravelTournaments\Models\Team
{
protected static function boot()
parent::boot();
static::deleting(function ($team) {
$teams = Team::where('championship_id', $team->championship_id)
->where('id', '>', $team->id)->get();
foreach ($teams as $team) {
$team
$team->short_id--;
short_id
App\Team
Checks if undeclared accessed properties appear in database migrations and if the creating migration is correct.
$team->save();
}
});
/**
* Get all Invitations that belongs to a team
* @return \Illuminate\Database\Eloquent\Relations\MorphMany
*/
public function invites()
return $this->morphMany(Invite::class, 'object');
public function requests()
return $this->morphMany(Request::class, 'object');