InstanceController.php 660 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace App\Http\Controllers;
  3. use Illuminate\Http\Request;
  4. use App\Services\PixelfedVersions;
  5. use App\Instance;
  6. class InstanceController extends Controller
  7. {
  8. public function index(Request $request)
  9. {
  10. return view('instance.index');
  11. }
  12. public function add(Request $request)
  13. {
  14. return view('instance.add');
  15. }
  16. public function show(Request $request, $domain)
  17. {
  18. $instance = Instance::whereDomain($domain)
  19. ->whereNotNull('approved_at')
  20. ->whereIn('nodeinfo->software->version', PixelfedVersions::get())
  21. ->firstOrFail();
  22. return view('instance.show', compact('instance'));
  23. }
  24. }