ajun 5 vuotta sitten
vanhempi
commit
b2d1692bd1
1 muutettua tiedostoa jossa 10 lisäystä ja 0 poistoa
  1. 10 0
      app/Http/Controllers/AuthorityController.php

+ 10 - 0
app/Http/Controllers/AuthorityController.php

@@ -3,16 +3,20 @@
 namespace App\Http\Controllers;
 
 use App\Authority;
+use App\Components\AsyncResponse;
 use App\Owner;
 use Exception;
 use Illuminate\Http\Request;
 use Illuminate\Http\Response;
+use Illuminate\Queue\RedisQueue;
 use Illuminate\Support\Facades\Auth;
 use Illuminate\Support\Facades\Gate;
 use Illuminate\Support\Facades\Validator;
 
 class AuthorityController extends Controller
 {
+    use AsyncResponse;
+
     /**
      * Display a listing of the resource.
      *
@@ -159,4 +163,10 @@ class AuthorityController extends Controller
         $re=$authority->delete();
         return ['success'=>$re];
     }
+
+    public function getAuthoritiesApi()
+    {
+        $authority = Authority::query()->orderBy('name')->get();
+        $this->success($authority);
+    }
 }