StoreController.php 782 B

1234567891011121314151617181920212223242526
  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. if (env('APP_ENV' , 'local') == 'local') $isPaypalSetup = true;
  17. return view('store.index')->with([
  18. 'products' => PaypalProduct::where('disabled' , '=' , false)->orderBy('price' , 'asc')->get(),
  19. 'isPaypalSetup' => $isPaypalSetup
  20. ]);
  21. }
  22. }