Learner\Repositories\Eloquent\VideoRepository::create PHP Метод

create() публичный Метод

Create a video.
public create ( array $data ) : array
$data array
Результат array
    public function create(array $data)
    {
        $newVideo = $this->getNew();
        $newVideo->title = $data['title'];
        $newVideo->series_id = $data['series_id'];
        $newVideo->description = $data['description'];
        $newVideo->resource_type = $data['resource_type'];
        $newVideo->resource_id = $data['resource_id'];
        $newVideo->image = $data['image'];
        $newVideo->duration = $data['duration'];
        $newVideo->published_at = Carbon::createFromFormat('Y-m-d', $data['published_at']);
        $newVideo->save();
        $newVideo->published_at = $newVideo->published_at->toDateTimeString();
        return $newVideo;
    }