for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of Gitamin.
*
* Copyright (C) 2015-2016 The Gitamin Team
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
# == Schema Information
#
# Table name: namespaces
# id :integer not null, primary key
# name :string(255) not null
# path :string(255) not null
# owner_id :integer
# created_at :datetime
# updated_at :datetime
# type :string(255)
# description :string(255) default(""), not null
# avatar :string(255)
# public :boolean default(FALSE)
namespace Gitamin\Models;
use AltThree\Validator\ValidatingTrait;
use Illuminate\Database\Eloquent\Model;
class ProjectNamespace extends Model
{
use ValidatingTrait;
/**
* The attributes that should be casted to native types.
* @var string[]
protected $casts = [
'id' => 'int',
'name' => 'string',
'path' => 'string',
'type' => 'string',
];
* The fillable properties.
protected $fillable = ['name', 'path', 'type'];
* The validation rules.
public $rules = [
'name' => 'required|string',
'path' => 'required|string',
* A namespace can have many projects.
* @return \Illuminate\Database\Eloquent\Relations\HasMany
public function projects()
return $this->hasMany(Project::class, 'namespace_id', 'id');
}