Files
wticreatorstudio/Modules/Frontend/Repositories/SectionRepository.php
T

42 lines
735 B
PHP

<?php
namespace Modules\Frontend\Repositories;
use Modules\Frontend\Entities\Section;
class SectionRepository
{
public function all()
{
return Section::all();
}
public function create($title, $layout)
{
return Section::create([
'title' => $title,
'layout' => $layout,
]);
}
public function update($id, $title, $layout)
{
$section = Section::find($id);
if ($section) {
$section->title = $title;
$section->layout = $layout;
$section->update();
return $section;
}
return false;
}
public function destroy($id)
{
return Section::destroy($id);
}
}