Files
vuefilemanager/app/Http/Controllers/General/PricingController.php
2020-06-19 08:03:29 +02:00

36 lines
721 B
PHP

<?php
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()
{
$collection = new PricingCollection(
$this->stripe->getActivePlans()
);
return $collection->sortBy('product.metadata.capacity')
->values()
->all();
}
}