frontend/backend update

This commit is contained in:
carodej
2020-06-05 16:48:11 +02:00
parent ca14838212
commit cffdc3ced9
67 changed files with 3611 additions and 1136 deletions
+9 -1
View File
@@ -16,6 +16,11 @@
|--------------------------------------------------------------------------
*/
// Plans
Route::group(['middleware' => ['api'], 'prefix' => 'public'], function () {
Route::get('/pricing', 'General\PricingController@index');
});
// Public routes
Route::group(['middleware' => ['api']], function () {
@@ -56,6 +61,9 @@ Route::group(['middleware' => ['auth:api', 'auth.master', 'scope:master']], func
Route::get('/user', 'User\AccountController@user');
Route::get('/profile', 'User\AccountController@me');
// Subscription
Route::post('/upgrade', 'User\SubscriptionController@upgrade');
// Browse
Route::get('/participant-uploads', 'FileBrowser\BrowseController@participant_uploads');
Route::get('/file-detail/{unique_id}', 'FileBrowser\BrowseController@file_detail');
@@ -109,13 +117,13 @@ Route::group(['middleware' => ['auth:api', 'auth.master', 'auth.admin', 'scope:m
Route::get('/plans/{id}', 'Admin\PlanController@show');
Route::post('/plans/store', 'Admin\PlanController@store');
Route::patch('/plans/{id}/update', 'Admin\PlanController@update');
Route::get('/plans/{id}/subscribers', 'Admin\PlanController@subscribers');
// Invoices
Route::get('/invoices', 'Admin\InvoiceController@index');
Route::get('/invoices/{token}', 'Admin\InvoiceController@show');
});
// Protected sharing routes for authenticated user
Route::group(['middleware' => ['auth:api', 'auth.shared', 'scope:visitor,editor']], function () {
+60
View File
@@ -11,6 +11,66 @@
|
*/
use App\User;
use Rinvex\Subscriptions\Models\PlanFeature;
Route::get('/debug', function () {
/*
* 1. Create plan
*/
/* $plan = app('rinvex.subscriptions.plan')->create([
'name' => 'Starter Pack',
'description' => 'The best for start with',
'price' => 9.99,
'signup_fee' => 0,
'invoice_period' => 1,
'invoice_interval' => 'month',
'trial_period' => 7,
'trial_interval' => 'day',
'sort_order' => 1,
'currency' => 'USD',
]);
// Create multiple plan features at once
$plan->features()->saveMany([
new PlanFeature(['name' => 'Storage capacity', 'value' => 200, 'sort_order' => 1]),
]);
return $plan;
*/
/*
* 2. Get plan
*/
/* $plan = app('rinvex.subscriptions.plan')->find(6);
return $plan;
//return $plan->subscriptions;
$space = $plan->getFeatureBySlug('storage-capacity')->value;*/
//return $space;
/*
* 3. Create subscription
*/
$user = Auth::user();
//$plan = app('rinvex.subscriptions.plan')->find(6);
//return $user->activeSubscriptions();
return $user->subscription('Starter Pack')->cancel();
//$user->newSubscription('Starter Pack', $plan);
//return $plan->subscriptions;
//return $user->subscribedTo(5);
});
// Deployment Webhook URL
Route::post('/deploy/github', 'DeployController@github');