add offers count, & minor fixes code standards
This commit is contained in:
@@ -10,9 +10,15 @@ use App\Repositories\Languages;
|
||||
|
||||
class Applications
|
||||
{
|
||||
public static function select_all()
|
||||
|
||||
public static function getFullBySlug($slug)
|
||||
{
|
||||
return Application::all()->toArray();
|
||||
return Application::with('clients')->active()->bySlug($slug)->first();
|
||||
}
|
||||
|
||||
public static function getAll()
|
||||
{
|
||||
return Application::all();
|
||||
}
|
||||
|
||||
public static function getOptions()
|
||||
@@ -39,7 +45,9 @@ class Applications
|
||||
public static function update($data, $id = false)
|
||||
{
|
||||
$id = $id ? $id : $data['id'];
|
||||
return self::get($id)->update($data);
|
||||
$item = self::get($id);
|
||||
$item->update($data);
|
||||
return $item;
|
||||
}
|
||||
|
||||
public static function destroy($id)
|
||||
@@ -97,4 +105,12 @@ class Applications
|
||||
{
|
||||
return Application::active()->bySlug($slug)->first();
|
||||
}
|
||||
|
||||
public static function toggleActive($id, $active) {
|
||||
return self::update(['active' => $active], $id);
|
||||
}
|
||||
|
||||
public static function toggleVisible($id, $visible) {
|
||||
return self::update(['visible' => $visible], $id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user