mirror of
https://github.com/Bigherollc/wticreatorstudio.git
synced 2026-10-17 21:03:00 -04:00
44 lines
793 B
PHP
44 lines
793 B
PHP
<?php
|
|
|
|
namespace Modules\Frontend\Repositories;
|
|
|
|
use Modules\Frontend\Entities\SocialMedia;
|
|
|
|
class SocialMediaRepository
|
|
{
|
|
public function all()
|
|
{
|
|
return SocialMedia::all();
|
|
}
|
|
|
|
public function create($name, $url, $icon)
|
|
{
|
|
return SocialMedia::create([
|
|
'name' => $name,
|
|
'url' => $url,
|
|
'icon' => $icon,
|
|
]);
|
|
}
|
|
|
|
public function update($id, $name, $url, $icon)
|
|
{
|
|
$item = SocialMedia::find($id);
|
|
|
|
if ($item) {
|
|
$item->name = $name;
|
|
$item->url = $url;
|
|
$item->icon = $icon;
|
|
$item->update();
|
|
|
|
return $item;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
public function destroy($id)
|
|
{
|
|
return SocialMedia::destroy($id);
|
|
}
|
|
}
|