frontend & backend update

This commit is contained in:
carodej
2020-06-19 08:03:29 +02:00
parent 95bc310def
commit a2cab6198e
83 changed files with 4464 additions and 1907 deletions

View File

@@ -4,19 +4,32 @@ namespace App\Http\Controllers\General;
use App\Http\Controllers\Controller;
use App\Http\Resources\PricingCollection;
use App\Services\StripeService;
use Illuminate\Http\Request;
class PricingController extends Controller
{
/**
* PlanController constructor.
*/
public function __construct(StripeService $stripe)
{
$this->stripe = $stripe;
}
/**
* Get all active plans
*
* @return PricingCollection
*/
public function index() {
return new PricingCollection(
app('rinvex.subscriptions.plan')->where('is_active', 1)->get()
public function index()
{
$collection = new PricingCollection(
$this->stripe->getActivePlans()
);
return $collection->sortBy('product.metadata.capacity')
->values()
->all();
}
}