the RunwareAI Plugin is working now
This commit is contained in:
@@ -10,7 +10,8 @@ class StyleController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$styles = Style::where('enabled', true)
|
||||
$styles = Style::with(['aiModel.apiProviders'])
|
||||
->where('enabled', true)
|
||||
->whereHas('aiModel', function ($query) {
|
||||
$query->where('enabled', true);
|
||||
$query->whereHas('apiProviders', function ($query) {
|
||||
@@ -19,6 +20,10 @@ class StyleController extends Controller
|
||||
})
|
||||
->get();
|
||||
|
||||
if ($styles->isEmpty()) {
|
||||
return response()->json(['message' => __('api.no_styles_available')], 404);
|
||||
}
|
||||
|
||||
return response()->json($styles);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user