[WIP] Working on uploader
This commit is contained in:
@@ -8,25 +8,25 @@ use Illuminate\Support\Str;
|
||||
|
||||
use Yajra\DataTables\DataTables;
|
||||
|
||||
use App\Models\Shop\Article;
|
||||
use App\Models\Shop\ArticleComponent;
|
||||
|
||||
class Articles
|
||||
class ArticleComponents
|
||||
{
|
||||
|
||||
public static function getDatatable()
|
||||
{
|
||||
$model = Article::orderBy('name');
|
||||
$model = ArticleComponent::orderBy('name');
|
||||
return Datatables::of($model)->make(true);
|
||||
}
|
||||
|
||||
public static function getAll()
|
||||
{
|
||||
return Article::orderBy('name','asc')->get();
|
||||
return ArticleComponent::orderBy('name','asc')->get();
|
||||
}
|
||||
|
||||
public static function get($id)
|
||||
{
|
||||
return Article::find($id);
|
||||
return ArticleComponent::find($id);
|
||||
}
|
||||
|
||||
public static function store($data)
|
||||
@@ -38,17 +38,17 @@ class Articles
|
||||
|
||||
public static function create($data)
|
||||
{
|
||||
return Article::create($data);
|
||||
return ArticleComponent::create($data);
|
||||
}
|
||||
|
||||
public static function update($data)
|
||||
{
|
||||
return Article::find($id)->update($data);
|
||||
return ArticleComponent::find($id)->update($data);
|
||||
}
|
||||
|
||||
public static function destroy($id)
|
||||
{
|
||||
return Article::destroy($id);
|
||||
return ArticleComponent::destroy($id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user