for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Rinvex\Statistics\Models;
use Illuminate\Database\Eloquent\Model;
use Rinvex\Cacheable\CacheableEloquent;
use Rinvex\Support\Traits\ValidatingTrait;
use Illuminate\Database\Eloquent\Relations\HasMany;
class Platform extends Model
{
use ValidatingTrait;
use CacheableEloquent;
/**
* {@inheritdoc}
*/
protected $fillable = [
'family',
'version',
];
protected $casts = [
'family' => 'string',
'version' => 'string',
public $timestamps = false;
protected $observables = [
'validating',
'validated',
* The default rules that the model will validate against.
*
* @var array
protected $rules = [
'family' => 'required|string',
'version' => 'nullable|string',
* Whether the model should throw a
* ValidationException if it fails validation.
* @var bool
protected $throwValidationExceptions = true;
* Create a new Eloquent model instance.
* @param array $attributes
public function __construct(array $attributes = [])
parent::__construct($attributes);
$this->setTable(config('rinvex.statistics.tables.platforms'));
}
* The platform may have many requests.
* @return \Illuminate\Database\Eloquent\Relations\HasMany
public function requests(): HasMany
return $this->hasMany(config('rinvex.statistics.models.request'), 'platform_id', 'id');