Cleanup Model doc

This commit is contained in:
Nabeel Shahzad
2019-12-22 09:46:41 +05:00
parent e862537a20
commit 66a1192739
5 changed files with 7 additions and 22 deletions
+4 -12
View File
@@ -6,25 +6,17 @@ namespace App\Contracts;
* @property mixed $id * @property mixed $id
* @property bool $skip_mutator * @property bool $skip_mutator
* *
* @method static Model create(array $attrs) * @mixin \Illuminate\Database\Eloquent\Builder
* @method static Model find(int $id)
* @method static Model select(array $array)
* @method static Model where(array $array)
* @method static Model firstOrCreate(array $where, array $array)
* @method static Model updateOrCreate(array $array, array $attrs)
* @method static truncate()
* @method Model orderBy(string $column, string $order)
* @method Model limit(int $limit)
* @method Model first()
*/ */
abstract class Model extends \Illuminate\Database\Eloquent\Model abstract class Model extends \Illuminate\Database\Eloquent\Model
{ {
/**
* Max length of ID for string columns
*/
public const ID_MAX_LENGTH = 12; public const ID_MAX_LENGTH = 12;
/** /**
* For the factories, skip the mutators. Only apply to one instance * For the factories, skip the mutators. Only apply to one instance
*
* @var bool
*/ */
public $skip_mutator = false; public $skip_mutator = false;
} }
+1 -3
View File
@@ -5,9 +5,7 @@ namespace App\Models;
use Laratrust\Models\LaratrustRole; use Laratrust\Models\LaratrustRole;
/** /**
* @method static where(string $string, $group) * @mixin \Illuminate\Database\Eloquent\Builder
* @method static firstOrCreate(array $array, array $array1)
* @method static truncate()
*/ */
class Role extends LaratrustRole class Role extends LaratrustRole
{ {
+1 -3
View File
@@ -35,9 +35,7 @@ use Laratrust\Traits\LaratrustUserTrait;
* @property bool opt_in * @property bool opt_in
* @property string last_pirep_id * @property string last_pirep_id
* *
* @method static updateOrCreate(array $array, array $attrs) * @mixin \Illuminate\Database\Eloquent\Builder
* @method static where()
* @method static truncate()
* @mixin \Illuminate\Notifications\Notifiable * @mixin \Illuminate\Notifications\Notifiable
* @mixin \Laratrust\Traits\LaratrustUserTrait * @mixin \Laratrust\Traits\LaratrustUserTrait
*/ */
-3
View File
@@ -7,9 +7,6 @@ use App\Models\Airline;
use Prettus\Repository\Contracts\CacheableInterface; use Prettus\Repository\Contracts\CacheableInterface;
use Prettus\Repository\Traits\CacheableRepository; use Prettus\Repository\Traits\CacheableRepository;
/**
* Class AirlineRepository
*/
class AirlineRepository extends Repository implements CacheableInterface class AirlineRepository extends Repository implements CacheableInterface
{ {
use CacheableRepository; use CacheableRepository;
+1 -1
View File
@@ -92,7 +92,7 @@ class UserService extends Service
*/ */
public function addUserToRole(User $user, $roleName): User public function addUserToRole(User $user, $roleName): User
{ {
$role = Role::where('name', $roleName)->first(); $role = Role::where(['name' => $roleName])->first();
$user->attachRole($role); $user->attachRole($role);
return $user; return $user;