CatchAllController.php 480 B

12345678910111213141516171819
  1. <?php
  2. namespace App\Http\Controllers;
  3. use App\Http\Requests\UpdateCatchAllRequest;
  4. class CatchAllController extends Controller
  5. {
  6. public function update(UpdateCatchAllRequest $request)
  7. {
  8. if ($request->catch_all) {
  9. user()->enableCatchAll();
  10. } else {
  11. user()->disableCatchAll();
  12. }
  13. return back()->with(['status' => $request->catch_all ? 'Catch-All Enabled Successfully' : 'Catch-All Disabled Successfully']);
  14. }
  15. }