blue-twilight/app/Album.php

37 lines
659 B
PHP
Raw Normal View History

<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Http\Request;
use Illuminate\Notifications\Notifiable;
class Album extends Model
{
use Notifiable;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'description'
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
];
public function fromRequest(Request $request)
{
$this->name = $request->get('name');
$this->description = $request->get('description');
return $this;
}
}