laravel-4

Laravel/Cashier invoices() returns empty Object

佐手、 提交于 2020-12-01 13:30:39
问题 I've got a problem with the cashier package from Taylor (https://github.com/laravel/cashier). When I try to get the Invoices for a User the Object that is returned is Empty. For information i've set up my cashier database columns into a membership table! And then set up the proper relationships. I can charge the User if I do something like this: $user->membership->subscription('1month')->create($token); But if I want to get the invoices like so $invoices = $user->membership->invoices(); it

Laravel/Cashier invoices() returns empty Object

不羁的心 提交于 2020-12-01 13:29:33
问题 I've got a problem with the cashier package from Taylor (https://github.com/laravel/cashier). When I try to get the Invoices for a User the Object that is returned is Empty. For information i've set up my cashier database columns into a membership table! And then set up the proper relationships. I can charge the User if I do something like this: $user->membership->subscription('1month')->create($token); But if I want to get the invoices like so $invoices = $user->membership->invoices(); it

Laravel/Cashier invoices() returns empty Object

跟風遠走 提交于 2020-12-01 13:28:18
问题 I've got a problem with the cashier package from Taylor (https://github.com/laravel/cashier). When I try to get the Invoices for a User the Object that is returned is Empty. For information i've set up my cashier database columns into a membership table! And then set up the proper relationships. I can charge the User if I do something like this: $user->membership->subscription('1month')->create($token); But if I want to get the invoices like so $invoices = $user->membership->invoices(); it

Laravel Sum of relation

不打扰是莪最后的温柔 提交于 2020-11-29 19:20:30
问题 I want to return the sum of "amount" from my payments table. There can be many payments for one invoice. The below "->sum('amount') does not work, it returns: Call to a member function addEagerConstraints() on a non-object. How to return the sum of all payments for each invoice in my relation? Invoices Model: class Invoices extends Eloquent { public function payments() { return $this->hasMany('Payments')->sum('amount'); } } Expenses Model: class Payments extends Eloquent { public function

Laravel Sum of relation

人盡茶涼 提交于 2020-11-29 19:15:27
问题 I want to return the sum of "amount" from my payments table. There can be many payments for one invoice. The below "->sum('amount') does not work, it returns: Call to a member function addEagerConstraints() on a non-object. How to return the sum of all payments for each invoice in my relation? Invoices Model: class Invoices extends Eloquent { public function payments() { return $this->hasMany('Payments')->sum('amount'); } } Expenses Model: class Payments extends Eloquent { public function

Laravel Sum of relation

天涯浪子 提交于 2020-11-29 19:15:08
问题 I want to return the sum of "amount" from my payments table. There can be many payments for one invoice. The below "->sum('amount') does not work, it returns: Call to a member function addEagerConstraints() on a non-object. How to return the sum of all payments for each invoice in my relation? Invoices Model: class Invoices extends Eloquent { public function payments() { return $this->hasMany('Payments')->sum('amount'); } } Expenses Model: class Payments extends Eloquent { public function

Laravel: Get the name of the view that called the controller method

好久不见. 提交于 2020-11-29 19:14:17
问题 In laravel is it possible to get the name of the view that called the controller method that you're currently in? I have two version of a form in my site. One is meant to be used "outside" of the site (i.e. the user is not logged in) and the other is meant to be used "inside" of the site. The forms differ a bit in presentation, but they hold all of the same fields and call the same store method. Is there a way from within my store method to get the name of the view that called the method? I

Laravel Sum of relation

家住魔仙堡 提交于 2020-11-29 19:13:57
问题 I want to return the sum of "amount" from my payments table. There can be many payments for one invoice. The below "->sum('amount') does not work, it returns: Call to a member function addEagerConstraints() on a non-object. How to return the sum of all payments for each invoice in my relation? Invoices Model: class Invoices extends Eloquent { public function payments() { return $this->hasMany('Payments')->sum('amount'); } } Expenses Model: class Payments extends Eloquent { public function

Laravel Sum of relation

时光毁灭记忆、已成空白 提交于 2020-11-29 19:13:23
问题 I want to return the sum of "amount" from my payments table. There can be many payments for one invoice. The below "->sum('amount') does not work, it returns: Call to a member function addEagerConstraints() on a non-object. How to return the sum of all payments for each invoice in my relation? Invoices Model: class Invoices extends Eloquent { public function payments() { return $this->hasMany('Payments')->sum('amount'); } } Expenses Model: class Payments extends Eloquent { public function

Laravel: Get the name of the view that called the controller method

拜拜、爱过 提交于 2020-11-29 19:12:07
问题 In laravel is it possible to get the name of the view that called the controller method that you're currently in? I have two version of a form in my site. One is meant to be used "outside" of the site (i.e. the user is not logged in) and the other is meant to be used "inside" of the site. The forms differ a bit in presentation, but they hold all of the same fields and call the same store method. Is there a way from within my store method to get the name of the view that called the method? I