public function index()
 {
     $payments = Payment::all();
     $payments_count = count($payments);
     $sum_total = $payments->sum('total');
     $sum_cost = $payments->sum('cost');
     $sum_bv_total = $payments->sum('bv_cost');
     return view('payment.index', compact('payments', 'payments_count', 'sum_total', 'sum_cost', 'sum_bv_total'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     try {
         $payments = Payment::all();
         return response()->json(['code' => 200, 'data' => $payments], 200);
     } catch (Exception $e) {
         return response()->json(['code' => 500, 'messages' => 'Internal Server Error'], 500);
     }
 }
 /**
  * Show the board index for the user.
  *
  * @return Response
  */
 public function getContribute()
 {
     $devStart = new Carbon(static::$ContributeProjectStart);
     $devCarbon = new Carbon(static::$ContributePublicStart);
     $donors = Payment::all();
     $donationsTotal = 0;
     foreach ($donors as $donor) {
         $donationsTotal += $donor->amount;
     }
     $devEnd = clone $devCarbon;
     $devTime = $donationsTotal / 100 / (double) env('CONTRIB_HOUR_COST', 10) * static::$ContributeDevInflation;
     $devEnd->addHours($devTime);
     return response()->json(['development_start' => $devStart->toRfc2822String(), 'development_public' => $devCarbon->toRfc2822String(), 'development_paid_until' => $devEnd->toRfc2822String(), 'donations_total' => $donationsTotal, 'donors' => $donors->toJson()]);
 }
 /**
  * Show the board index for the user.
  *
  * @return Response
  */
 public function getContribute()
 {
     $devStart = new Carbon(static::$ContributeProjectStart);
     $devCarbon = new Carbon(static::$ContributePublicStart);
     $donors = Payment::all();
     $donationsTotal = 0;
     foreach ($donors as $donor) {
         $donationsTotal += $donor->amount;
     }
     $devEnd = clone $devCarbon;
     $devTime = $donationsTotal / 100 / (double) env('CONTRIB_HOUR_COST', 10) * static::$ContributeDevInflation;
     $devEnd->addHours($devTime);
     $json = ['development_start' => $devStart->toRfc2822String(), 'development_public' => $devCarbon->toRfc2822String(), 'development_paid_until' => $devEnd->toRfc2822String(), 'donations_total' => $donationsTotal];
     $input = Input::all();
     if (isset($input['wantsDonors'])) {
         $json['donors'] = $donors->toJson();
     }
     return response()->json($json)->header('Access-Control-Allow-Origin', "*");
 }
 /**
  * List all payments
  * 
  * @return Response
  */
 public function index()
 {
     $payments = Payment::all();
     return view('index', compact('payments'));
 }
 public function index()
 {
     return response()->json(['payment_methods' => Payment::all()]);
 }
Beispiel #7
0
Route::get('/', function () {
    return view('home');
});
// Registration routes...
Route::get('auth/register', 'Auth\\AuthController@getRegister');
Route::post('auth/register', 'Auth\\AuthController@postRegister');
// Authentication routes...
Route::get('auth/login', 'Auth\\AuthController@getLogin');
Route::post('auth/login', 'Auth\\AuthController@postLogin');
Route::get('auth/logout', 'Auth\\AuthController@getLogout');
// Password reset link request routes...
Route::get('password/email', 'Auth\\PasswordController@getEmail');
Route::post('password/email', 'Auth\\PasswordController@postEmail');
// Password reset routes...
Route::get('password/reset/{token}', 'Auth\\PasswordController@getReset');
Route::post('password/reset', 'Auth\\PasswordController@postReset');
// Ressource REST API routes
Route::resource('order', 'OrderController', ['only' => ['store', 'index', 'create', 'show']]);
Route::resource('payment', 'PaymentController', ['only' => ['store', 'show']]);
Route::resource('customer', 'CustomerController', ['only' => ['store', 'show']]);
// Admin page
Route::get('/admin', ['middleware' => 'auth', function () {
    /*
     * Displays a table of all direct debit payments requested so far 
     */
    $orders = Order::orderBy('group', 'asc')->with('payment', 'customer')->get()->all();
    $payments = Payment::all();
    $customers = Customer::all();
    return view('admin', ['orders' => $orders, 'payments' => $payments, 'customers' => $customers]);
}]);
Route::controllers(['password' => 'Auth\\PasswordController']);
 public function getIndex()
 {
     return view('a.payment')->with('payments', Payment::all());
 }