StoreController.php 710 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace App\Http\Controllers;
  3. use App\Models\PaypalProduct;
  4. use Illuminate\Contracts\Foundation\Application;
  5. use Illuminate\Contracts\View\Factory;
  6. use Illuminate\Contracts\View\View;
  7. use Illuminate\Http\Request;
  8. use Illuminate\Http\Response;
  9. class StoreController extends Controller
  10. {
  11. /** Display a listing of the resource. */
  12. public function index()
  13. {
  14. $isPaypalSetup = false;
  15. if (env('PAYPAL_SECRET') && env('PAYPAL_CLIENT_ID')) $isPaypalSetup = true;
  16. return view('store.index')->with([
  17. 'products' => PaypalProduct::where('disabled' , '=' , false)->orderBy('price' , 'asc')->get(),
  18. 'isPaypalSetup' => $isPaypalSetup
  19. ]);
  20. }
  21. }