mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-06 02:33:48 +00:00
- API routes refactoring
- setup:dev artisan command
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,4 +1,4 @@
|
||||
/app/Console/Commands/SetupDevelopmentEnvironment.php
|
||||
/app/Console/Commands/SetupDevEnvironment.php
|
||||
/node_modules
|
||||
/public/hot
|
||||
/public/storage
|
||||
|
||||
@@ -230,7 +230,7 @@ VueFileManager is packed with **Stripe** payment options. To configure Stripe, y
|
||||
## Get your active plans
|
||||
Would you like to get your subscription plans for your custom front-end page? Create GET request and get all your active plans:
|
||||
```
|
||||
GET /api/public/pricing
|
||||
GET /api/pricing
|
||||
```
|
||||
|
||||
## Manage Failed Payments
|
||||
|
||||
@@ -32,10 +32,16 @@ class CreateNewUser implements CreatesNewUsers
|
||||
'password' => $this->passwordRules(),
|
||||
])->validate();
|
||||
|
||||
return User::create([
|
||||
$user = User::create([
|
||||
'name' => $input['name'],
|
||||
'email' => $input['email'],
|
||||
'password' => Hash::make($input['password']),
|
||||
]);
|
||||
|
||||
$user->settings()->create([
|
||||
'name' => $input['name']
|
||||
]);
|
||||
|
||||
return $user;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
class Deploy extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'deploy:production';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Automatic deployment for production';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
// Start deployment
|
||||
$this->info('Running auto deployment');
|
||||
$this->call('down');
|
||||
|
||||
// Exec commands
|
||||
exec('git pull origin ' . config('app.deploy_branch'));
|
||||
//exec('composer update --no-interaction --prefer-dist');
|
||||
$this->migrateDatabase();
|
||||
|
||||
// Stop deployment
|
||||
$this->call('up');
|
||||
$this->info('Everything is done, congratulations! 🥳🥳🥳');
|
||||
|
||||
Log::info('Application was updated!');
|
||||
}
|
||||
|
||||
/**
|
||||
* Migrate database
|
||||
*/
|
||||
public function migrateDatabase()
|
||||
{
|
||||
$this->call('migrate', [
|
||||
'--force' => true,
|
||||
]);
|
||||
}
|
||||
}
|
||||
199
app/Console/Commands/SetupDevEnvironment.php
Normal file
199
app/Console/Commands/SetupDevEnvironment.php
Normal file
@@ -0,0 +1,199 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Page;
|
||||
use App\Setting;
|
||||
use App\User;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Faker;
|
||||
|
||||
class SetupDevEnvironment extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'setup:dev';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Set up development environment';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->faker = Faker\Factory::create();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$this->info('Setting up development environment');
|
||||
|
||||
$this->migrate_and_generate();
|
||||
$this->store_data();
|
||||
$this->seed_default_content();
|
||||
$this->create_admin();
|
||||
$this->clear_cache();
|
||||
|
||||
$this->info('Everything is done, congratulations! 🥳🥳🥳');
|
||||
}
|
||||
|
||||
/**
|
||||
* Create default admin account
|
||||
*/
|
||||
private function create_admin(): void
|
||||
{
|
||||
$user = User::forceCreate([
|
||||
'role' => 'admin',
|
||||
'name' => 'John Doe',
|
||||
'email' => 'john@doe.com',
|
||||
'password' => Hash::make('secret'),
|
||||
]);
|
||||
|
||||
$user
|
||||
->settings()
|
||||
->create([
|
||||
'storage_capacity' => 5,
|
||||
'name' => 'John Doe',
|
||||
'address' => $this->faker->address,
|
||||
'state' => $this->faker->state,
|
||||
'city' => $this->faker->city,
|
||||
'postal_code' => $this->faker->postcode,
|
||||
'country' => $this->faker->randomElement(['SK', 'CZ', 'DE', 'FR']),
|
||||
'phone_number' => $this->faker->phoneNumber,
|
||||
'timezone' => $this->faker->randomElement(['+1.0', '+2.0', '+3.0']),
|
||||
]);
|
||||
|
||||
// Show user credentials
|
||||
$this->info('Default admin account created. Email: john@doe.com and Password: secret');
|
||||
}
|
||||
|
||||
/**
|
||||
* Seed default content to database
|
||||
*/
|
||||
private function seed_default_content(): void
|
||||
{
|
||||
collect(config('content.content'))
|
||||
->each(function ($content) {
|
||||
Setting::updateOrCreate($content);
|
||||
});
|
||||
|
||||
collect(config('content.pages'))
|
||||
->each(function ($page) {
|
||||
Page::updateOrCreate($page);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Store main app settings into database
|
||||
*/
|
||||
private function store_data(): void
|
||||
{
|
||||
// Get options
|
||||
$settings = collect([
|
||||
[
|
||||
'name' => 'setup_wizard_database',
|
||||
'value' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'app_title',
|
||||
'value' => 'VueFileManager',
|
||||
],
|
||||
[
|
||||
'name' => 'app_description',
|
||||
'value' => 'Your self-hosted storage cloud software powered by Laravel and Vue',
|
||||
],
|
||||
[
|
||||
'name' => 'app_logo',
|
||||
'value' => null,
|
||||
],
|
||||
[
|
||||
'name' => 'app_logo_horizontal',
|
||||
'value' => null,
|
||||
],
|
||||
[
|
||||
'name' => 'app_favicon',
|
||||
'value' => null,
|
||||
],
|
||||
[
|
||||
'name' => 'google_analytics',
|
||||
'value' => '',
|
||||
],
|
||||
[
|
||||
'name' => 'contact_email',
|
||||
'value' => '',
|
||||
],
|
||||
[
|
||||
'name' => 'registration',
|
||||
'value' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'storage_limitation',
|
||||
'value' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'storage_default',
|
||||
'value' => 5,
|
||||
],
|
||||
[
|
||||
'name' => 'setup_wizard_success',
|
||||
'value' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'license',
|
||||
'value' => 'Extended',
|
||||
],
|
||||
[
|
||||
'name' => 'purchase_code',
|
||||
'value' => '26b889eb-3602-4bf2-beb3-3sc378fcf484',
|
||||
]
|
||||
]);
|
||||
|
||||
// Store options
|
||||
$settings->each(function ($col) {
|
||||
Setting::updateOrCreate(['name' => $col['name']], $col);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Migrate database and generate application keys
|
||||
*/
|
||||
private function migrate_and_generate(): void
|
||||
{
|
||||
// Generate app key
|
||||
$this->call('key:generate', [
|
||||
'--force' => true
|
||||
]);
|
||||
|
||||
// Migrate database
|
||||
$this->call('migrate:fresh', [
|
||||
'--force' => true
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Clear app cache
|
||||
*/
|
||||
private function clear_cache(): void
|
||||
{
|
||||
$this->call('cache:clear');
|
||||
$this->call('config:clear');
|
||||
$this->call('view:clear');
|
||||
}
|
||||
}
|
||||
@@ -2,12 +2,7 @@
|
||||
|
||||
namespace App\Console;
|
||||
|
||||
use App\Console\Commands\Deploy;
|
||||
|
||||
// use App\Console\Commands\SetupDevelopmentEnvironment;
|
||||
use App\Console\Commands\SetupDevEnvironment;
|
||||
use App\Console\Commands\SetupProductionEnvironment;
|
||||
use App\Console\Commands\UpgradeApp;
|
||||
use App\Share;
|
||||
use App\Zip;
|
||||
use Carbon\Carbon;
|
||||
@@ -22,8 +17,7 @@ class Kernel extends ConsoleKernel
|
||||
* @var array
|
||||
*/
|
||||
protected $commands = [
|
||||
Deploy::class,
|
||||
// SetupDevelopmentEnvironment::class,
|
||||
SetupDevEnvironment::class,
|
||||
];
|
||||
|
||||
/**
|
||||
|
||||
@@ -39,69 +39,7 @@ class UpgradeAppController extends Controller
|
||||
*/
|
||||
public function upgrade()
|
||||
{
|
||||
/*
|
||||
* Upgrade user_settings & file_manager_folders table
|
||||
*
|
||||
* @since v1.8.1
|
||||
*/
|
||||
if (! Schema::hasColumn('user_settings', 'timezone') && ! Schema::hasColumn('file_manager_folders', 'icon_color')) {
|
||||
|
||||
$this->upgrade_database();
|
||||
|
||||
// Create legal pages and index content for regular license
|
||||
if (get_setting('license') === 'Regular') {
|
||||
|
||||
$pages = collect(config('content.pages'));
|
||||
$content = collect(config('content.content_regular'));
|
||||
|
||||
$content->each(function ($content) {
|
||||
Setting::updateOrCreate($content);
|
||||
});
|
||||
|
||||
$pages->each(function ($page) {
|
||||
Page::updateOrCreate($page);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Upgrade expire_in in shares table
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
if (! Schema::hasTable('traffic') && ! Schema::hasTable('zips') && ! Schema::hasTable('jobs')) {
|
||||
|
||||
$this->upgrade_database();
|
||||
}
|
||||
/*
|
||||
* Upgrade expire_in in shares table
|
||||
*
|
||||
* @since v1.8
|
||||
*/
|
||||
if (! Schema::hasTable('traffic') && ! Schema::hasTable('zips') && ! Schema::hasTable('jobs')) {
|
||||
|
||||
$this->upgrade_database();
|
||||
}
|
||||
|
||||
/*
|
||||
* Upgrade expire_in in shares table
|
||||
*
|
||||
* @since v1.7.9
|
||||
*/
|
||||
if (! Schema::hasColumn('shares', 'expire_in')) {
|
||||
|
||||
$this->upgrade_database();
|
||||
}
|
||||
|
||||
/*
|
||||
* Upgrade expire_in in shares table
|
||||
*
|
||||
* @since v1.7.11
|
||||
*/
|
||||
if (! Schema::hasColumn('file_manager_files', 'metadata')) {
|
||||
|
||||
$this->upgrade_database();
|
||||
}
|
||||
$this->upgrade_database();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -125,7 +125,11 @@ class AccountController extends Controller
|
||||
}
|
||||
|
||||
// Update text data
|
||||
$user->settings->update(make_single_input($request));
|
||||
$user
|
||||
->settings()
|
||||
->update(
|
||||
make_single_input($request)
|
||||
);
|
||||
|
||||
return response('Saved!', 204);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
namespace App\Models;
|
||||
|
||||
use App\Notifications\ResetPassword;
|
||||
use App\Notifications\ResetUserPasswordNotification;
|
||||
use App\UserSettings;
|
||||
use ByteUnits\Metric;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
@@ -12,13 +13,12 @@ use Illuminate\Notifications\Notifiable;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Str;
|
||||
use Laravel\Cashier\Billable;
|
||||
use Laravel\Passport\HasApiTokens;
|
||||
use Kyslik\ColumnSortable\Sortable;
|
||||
use Rinvex\Subscriptions\Traits\HasSubscriptions;
|
||||
use Laravel\Sanctum\HasApiTokens;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
use Notifiable, Billable, Sortable, HasFactory, \Laravel\Sanctum\HasApiTokens;
|
||||
use Notifiable, Billable, Sortable, HasFactory, HasApiTokens;
|
||||
|
||||
protected $guarded = ['id', 'role'];
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ return [
|
||||
'providers' => [
|
||||
'users' => [
|
||||
'driver' => 'eloquent',
|
||||
'model' => App\User::class,
|
||||
'model' => App\Models\User::class,
|
||||
],
|
||||
|
||||
// 'users' => [
|
||||
|
||||
@@ -137,9 +137,9 @@ return [
|
||||
// Features::emailVerification(),
|
||||
Features::updateProfileInformation(),
|
||||
Features::updatePasswords(),
|
||||
Features::twoFactorAuthentication([
|
||||
/*Features::twoFactorAuthentication([
|
||||
'confirmPassword' => true,
|
||||
]),
|
||||
]),*/
|
||||
],
|
||||
|
||||
];
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\User;
|
||||
use App\Models\User;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
@@ -1,65 +1,78 @@
|
||||
{
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.js": "/chunks/files~chunks/shared-files~chunks/shared-page.js?id=74636ea45210d3b31adf",
|
||||
"/js/main.js": "/js/main.js?id=f2b97b07eeddc8fe61bb",
|
||||
"/css/app.css": "/css/app.css?id=dfd52fc997b919cd3686",
|
||||
"/chunks/admin.js": "/chunks/admin.js?id=7672646537b5813becf0",
|
||||
"/chunks/admin-account.js": "/chunks/admin-account.js?id=3f5a34aa8341af8d2b4c",
|
||||
"/chunks/app-appearance.js": "/chunks/app-appearance.js?id=9ec9a42482cb302a05f6",
|
||||
"/chunks/app-billings.js": "/chunks/app-billings.js?id=92903bd1d316b3db1dfa",
|
||||
"/chunks/app-email.js": "/chunks/app-email.js?id=9d646578982ba61813b6",
|
||||
"/chunks/app-index.js": "/chunks/app-index.js?id=4623bd961647897a5b81",
|
||||
"/chunks/app-others.js": "/chunks/app-others.js?id=b19a701cdfa06e4817ff",
|
||||
"/chunks/app-payments.js": "/chunks/app-payments.js?id=11c86d822269f1a1577e",
|
||||
"/chunks/app-settings.js": "/chunks/app-settings.js?id=6784314933372fb1adf0",
|
||||
"/chunks/app-setup.js": "/chunks/app-setup.js?id=d304bcf7d4157e81f3e2",
|
||||
"/chunks/billings-detail.js": "/chunks/billings-detail.js?id=b73a5b6f7d2a448cc5ab",
|
||||
"/chunks/contact-us.js": "/chunks/contact-us.js?id=81906d205ba0107c5105",
|
||||
"/chunks/create-new-password.js": "/chunks/create-new-password.js?id=004908727045abd0852e",
|
||||
"/chunks/dashboard.js": "/chunks/dashboard.js?id=cdfd468f0d0f98b9f081",
|
||||
"/chunks/database.js": "/chunks/database.js?id=b8d8269f77c52f78c784",
|
||||
"/chunks/dynamic-page.js": "/chunks/dynamic-page.js?id=2e3af103d13536c50757",
|
||||
"/chunks/environment-setup.js": "/chunks/environment-setup.js?id=106f81cefe76c62d476e",
|
||||
"/chunks/files.js": "/chunks/files.js?id=b213d4fe15c2a9933f32",
|
||||
"/chunks/forgotten-password.js": "/chunks/forgotten-password.js?id=95ce5e5685dc9315f515",
|
||||
"/chunks/installation-disclaimer.js": "/chunks/installation-disclaimer.js?id=6db12008aa646ad5fb6f",
|
||||
"/chunks/invoices.js": "/chunks/invoices.js?id=83389adf0760820af6f5",
|
||||
"/chunks/landing-page.js": "/chunks/landing-page.js?id=546ed735edf0d80c8a7e",
|
||||
"/chunks/not-found-shared.js": "/chunks/not-found-shared.js?id=848666d6c49c613f7f99",
|
||||
"/chunks/page-edit.js": "/chunks/page-edit.js?id=bd41ae13951c2a5025c3",
|
||||
"/chunks/pages.js": "/chunks/pages.js?id=df7245abef9e3b77a218",
|
||||
"/chunks/plan.js": "/chunks/plan.js?id=cfd7b4ee7e21639a837d",
|
||||
"/chunks/plan-create.js": "/chunks/plan-create.js?id=9bb62af36193ee9648d3",
|
||||
"/chunks/plan-delete.js": "/chunks/plan-delete.js?id=7b7601f044e0ef47720b",
|
||||
"/chunks/plan-settings.js": "/chunks/plan-settings.js?id=8d3e75ff9adb22a25d57",
|
||||
"/chunks/plan-subscribers.js": "/chunks/plan-subscribers.js?id=3b4a29497fc878f503db",
|
||||
"/chunks/plans.js": "/chunks/plans.js?id=feb924949bffcdf3d9fb",
|
||||
"/chunks/profile.js": "/chunks/profile.js?id=f990697f8d4ff45df434",
|
||||
"/chunks/purchase-code.js": "/chunks/purchase-code.js?id=5d7406ecd84c676db8fb",
|
||||
"/chunks/settings.js": "/chunks/settings.js?id=d16d9e2cda6aa3a3f6dc",
|
||||
"/chunks/settings-create-payment-methods.js": "/chunks/settings-create-payment-methods.js?id=b05e24dd8be60f62ee27",
|
||||
"/chunks/settings-invoices.js": "/chunks/settings-invoices.js?id=72d317b39264987e6ed0",
|
||||
"/chunks/settings-password.js": "/chunks/settings-password.js?id=014597c63c94d3ac9f60",
|
||||
"/chunks/settings-payment-methods.js": "/chunks/settings-payment-methods.js?id=2a0ea9cf661deba6fc13",
|
||||
"/chunks/settings-storage.js": "/chunks/settings-storage.js?id=b3f25de02dd4ef072df0",
|
||||
"/chunks/settings-subscription.js": "/chunks/settings-subscription.js?id=aa3d963f578d7bc5ff88",
|
||||
"/chunks/setup-wizard.js": "/chunks/setup-wizard.js?id=47090233afc7b0cdf855",
|
||||
"/chunks/shared-files.js": "/chunks/shared-files.js?id=ba10fd3f52a7b62d3092",
|
||||
"/chunks/shared-page.js": "/chunks/shared-page.js?id=4489cb4cfa33fb249bea",
|
||||
"/chunks/sign-in.js": "/chunks/sign-in.js?id=c52ce81c3dad56d7a7d8",
|
||||
"/chunks/sign-up.js": "/chunks/sign-up.js?id=2f12850d320b2413cf54",
|
||||
"/chunks/stripe-credentials.js": "/chunks/stripe-credentials.js?id=6622381f1d96e8319999",
|
||||
"/chunks/subscription-plans.js": "/chunks/subscription-plans.js?id=f1b093a3bcfebd5bc8a5",
|
||||
"/chunks/subscription-service.js": "/chunks/subscription-service.js?id=e0e2f821aac16b32da34",
|
||||
"/chunks/upgrade.js": "/chunks/upgrade.js?id=0c8d40bed72e86359529",
|
||||
"/chunks/upgrade-billing.js": "/chunks/upgrade-billing.js?id=a8db2246f9326e5c5957",
|
||||
"/chunks/upgrade-plan.js": "/chunks/upgrade-plan.js?id=f050f10627424b730dc2",
|
||||
"/chunks/user.js": "/chunks/user.js?id=6f2ab796211a3ac8670f",
|
||||
"/chunks/user-create.js": "/chunks/user-create.js?id=0d630acda4552c315417",
|
||||
"/chunks/user-delete.js": "/chunks/user-delete.js?id=db041eae3aef3e45197a",
|
||||
"/chunks/user-detail.js": "/chunks/user-detail.js?id=8cf2fe554e8d67ac8677",
|
||||
"/chunks/user-invoices.js": "/chunks/user-invoices.js?id=a0613909cb0c21817804",
|
||||
"/chunks/user-password.js": "/chunks/user-password.js?id=653bba3eb8d117c3a043",
|
||||
"/chunks/user-storage.js": "/chunks/user-storage.js?id=630b0ff649e16d3627af",
|
||||
"/chunks/user-subscription.js": "/chunks/user-subscription.js?id=0b4226ba77f10b83de4a",
|
||||
"/chunks/users.js": "/chunks/users.js?id=04ca09662595fae56488"
|
||||
"/js/main.js": "/js/main.js",
|
||||
"/css/app.css": "/css/app.css",
|
||||
"/chunks/admin.js": "/chunks/admin.js?id=06067d0f4cff64abd1e4",
|
||||
"/chunks/admin-account.js": "/chunks/admin-account.js?id=fde37ee0820a1d2dc1f9",
|
||||
"/chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chu~2d9ff916.js": "/chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chu~2d9ff916.js?id=1ad1b7b56512338223eb",
|
||||
"/chunks/admin-account~chunks/app-setup~chunks/billings-detail~chunks/create-new-password~chunks/datab~01aef58e.js": "/chunks/admin-account~chunks/app-setup~chunks/billings-detail~chunks/create-new-password~chunks/datab~01aef58e.js?id=6c02fe91a2e167b63a98",
|
||||
"/chunks/admin~chunks/files~chunks/settings~chunks/shared-files~chunks/shared-page.js": "/chunks/admin~chunks/files~chunks/settings~chunks/shared-files~chunks/shared-page.js?id=50155ecdafab2d18dda1",
|
||||
"/chunks/app-appearance.js": "/chunks/app-appearance.js?id=ba3c9a7acbaacc20af9e",
|
||||
"/chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chunks/app-others~chunks~605f4c49.js": "/chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chunks/app-others~chunks~605f4c49.js?id=fd3c7242b5c765b469e4",
|
||||
"/chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chunks/app-others~chunks~8cc7d96f.js": "/chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chunks/app-others~chunks~8cc7d96f.js?id=60421d0349712350e866",
|
||||
"/chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chunks/app-others~chunks~b9e5655a.js": "/chunks/app-appearance~chunks/app-billings~chunks/app-email~chunks/app-index~chunks/app-others~chunks~b9e5655a.js?id=a8bd98f9f181d9ee68fd",
|
||||
"/chunks/app-billings.js": "/chunks/app-billings.js?id=97f5c44884d8c2128c56",
|
||||
"/chunks/app-email.js": "/chunks/app-email.js?id=59c27449f65145dc208e",
|
||||
"/chunks/app-index.js": "/chunks/app-index.js?id=a337e0f9b64590a88cc9",
|
||||
"/chunks/app-others.js": "/chunks/app-others.js?id=1655c151466b066ee1c5",
|
||||
"/chunks/app-payments.js": "/chunks/app-payments.js?id=cb8ea484a0e605ace175",
|
||||
"/chunks/app-settings.js": "/chunks/app-settings.js?id=e8ee87b4fb155d3edb6b",
|
||||
"/chunks/app-settings~chunks/dashboard~chunks/invoices~chunks/page-edit~chunks/pages~chunks/plan~chunk~8a0e1d25.js": "/chunks/app-settings~chunks/dashboard~chunks/invoices~chunks/page-edit~chunks/pages~chunks/plan~chunk~8a0e1d25.js?id=99eb5ed6af46738c97e0",
|
||||
"/chunks/app-setup.js": "/chunks/app-setup.js?id=777ebaef548d5b4c61be",
|
||||
"/chunks/billings-detail.js": "/chunks/billings-detail.js?id=0eec974c6f0ee4e6ecab",
|
||||
"/chunks/contact-us.js": "/chunks/contact-us.js?id=b243adc35233292f8ad6",
|
||||
"/chunks/contact-us~chunks/dynamic-page~chunks/landing-page.js": "/chunks/contact-us~chunks/dynamic-page~chunks/landing-page.js?id=96ac1ede73f3fc9afa37",
|
||||
"/chunks/create-new-password.js": "/chunks/create-new-password.js?id=00b75239db203720652c",
|
||||
"/chunks/dashboard.js": "/chunks/dashboard.js?id=750c017c825ec385e0aa",
|
||||
"/chunks/dashboard~chunks/invoices~chunks/pages~chunks/plan-subscribers~chunks/plans~chunks/settings-i~0e2a0654.js": "/chunks/dashboard~chunks/invoices~chunks/pages~chunks/plan-subscribers~chunks/plans~chunks/settings-i~0e2a0654.js?id=d7795f20187163939276",
|
||||
"/chunks/database.js": "/chunks/database.js?id=212e2d81f6f5c54c2dd2",
|
||||
"/chunks/dynamic-page.js": "/chunks/dynamic-page.js?id=1d8ee4bfbcde69c97021",
|
||||
"/chunks/environment-setup.js": "/chunks/environment-setup.js?id=374911110bca4e1b3f91",
|
||||
"/chunks/files.js": "/chunks/files.js?id=d47d2964ef535ad5754c",
|
||||
"/chunks/files~chunks/settings-subscription~chunks/shared-files~chunks/shared-page~chunks/user-subscription.js": "/chunks/files~chunks/settings-subscription~chunks/shared-files~chunks/shared-page~chunks/user-subscription.js?id=e285e842f58178d681c4",
|
||||
"/chunks/files~chunks/shared-files~chunks/shared-page.js": "/chunks/files~chunks/shared-files~chunks/shared-page.js?id=880304f033df88daeedd",
|
||||
"/chunks/files~chunks/shared-page.js": "/chunks/files~chunks/shared-page.js?id=539a5b88c5f32511449e",
|
||||
"/chunks/forgotten-password.js": "/chunks/forgotten-password.js?id=f430110273d76b28906f",
|
||||
"/chunks/installation-disclaimer.js": "/chunks/installation-disclaimer.js?id=94c75dac20c4ccf7bde0",
|
||||
"/chunks/invoices.js": "/chunks/invoices.js?id=02089f329654fbbc894d",
|
||||
"/chunks/landing-page.js": "/chunks/landing-page.js?id=ddac17e6108c6f58f082",
|
||||
"/chunks/not-found-shared.js": "/chunks/not-found-shared.js?id=6666b81edc5ff6f60e82",
|
||||
"/chunks/page-edit.js": "/chunks/page-edit.js?id=7e6363b9a35e62dd560c",
|
||||
"/chunks/pages.js": "/chunks/pages.js?id=ca712437ecc7e5aeee5c",
|
||||
"/chunks/plan.js": "/chunks/plan.js?id=cc041fb9c2cb9ad8f0ff",
|
||||
"/chunks/plan-create.js": "/chunks/plan-create.js?id=24bb1297c55fe70c1dd0",
|
||||
"/chunks/plan-delete.js": "/chunks/plan-delete.js?id=e06dc32848cf3bfb9e6b",
|
||||
"/chunks/plan-settings.js": "/chunks/plan-settings.js?id=242cb0706c986d08c484",
|
||||
"/chunks/plan-subscribers.js": "/chunks/plan-subscribers.js?id=36a86cf6f3d8a2868504",
|
||||
"/chunks/plans.js": "/chunks/plans.js?id=282268d939f8b52f6acd",
|
||||
"/chunks/profile.js": "/chunks/profile.js?id=060bceb3f703969fb135",
|
||||
"/chunks/profile~chunks/settings-password.js": "/chunks/profile~chunks/settings-password.js?id=a44394b1fa09f996a9fd",
|
||||
"/chunks/purchase-code.js": "/chunks/purchase-code.js?id=8c1d40ff91c04fcefcfc",
|
||||
"/chunks/settings.js": "/chunks/settings.js?id=463a3b35eb4020fdcc77",
|
||||
"/chunks/settings-create-payment-methods.js": "/chunks/settings-create-payment-methods.js?id=4d1a070566ee2069e1bd",
|
||||
"/chunks/settings-invoices.js": "/chunks/settings-invoices.js?id=603b7f706f34d9c89a62",
|
||||
"/chunks/settings-password.js": "/chunks/settings-password.js?id=0df4bd46f1d3d90e360a",
|
||||
"/chunks/settings-payment-methods.js": "/chunks/settings-payment-methods.js?id=37955b9e8262af7fe525",
|
||||
"/chunks/settings-storage.js": "/chunks/settings-storage.js?id=013b6f15f907caaecd1e",
|
||||
"/chunks/settings-subscription.js": "/chunks/settings-subscription.js?id=5d702de3662f601fccca",
|
||||
"/chunks/setup-wizard.js": "/chunks/setup-wizard.js?id=99b4f321902fe6b0eb23",
|
||||
"/chunks/shared-files.js": "/chunks/shared-files.js?id=1860b9031f41ed46d0e0",
|
||||
"/chunks/shared-page.js": "/chunks/shared-page.js?id=d8a8c573da5a08b7cd36",
|
||||
"/chunks/sign-in.js": "/chunks/sign-in.js?id=6b961e6324b09384dfd0",
|
||||
"/chunks/sign-up.js": "/chunks/sign-up.js?id=a46f57a34f8f862a24a8",
|
||||
"/chunks/stripe-credentials.js": "/chunks/stripe-credentials.js?id=080bade1ed512f512591",
|
||||
"/chunks/subscription-plans.js": "/chunks/subscription-plans.js?id=5b2f00a9e19520adc31e",
|
||||
"/chunks/subscription-service.js": "/chunks/subscription-service.js?id=1ac6b87f8797b491ef77",
|
||||
"/chunks/upgrade.js": "/chunks/upgrade.js?id=ac1ff92a934e448ca6b4",
|
||||
"/chunks/upgrade-billing.js": "/chunks/upgrade-billing.js?id=198bfc33644f85bfc075",
|
||||
"/chunks/upgrade-billing~chunks/upgrade-plan.js": "/chunks/upgrade-billing~chunks/upgrade-plan.js?id=7e805915ede7c330c6d1",
|
||||
"/chunks/upgrade-plan.js": "/chunks/upgrade-plan.js?id=2811533956c0c185714d",
|
||||
"/chunks/user.js": "/chunks/user.js?id=a400499012c6786a3652",
|
||||
"/chunks/user-create.js": "/chunks/user-create.js?id=d5066d3ff9d7625ba7f1",
|
||||
"/chunks/user-delete.js": "/chunks/user-delete.js?id=5d392a3df7b05cf93930",
|
||||
"/chunks/user-detail.js": "/chunks/user-detail.js?id=fbfe45c7762f7ae123e4",
|
||||
"/chunks/user-invoices.js": "/chunks/user-invoices.js?id=97c78350b65914e4b16d",
|
||||
"/chunks/user-password.js": "/chunks/user-password.js?id=ad772e769a8562c42c17",
|
||||
"/chunks/user-storage.js": "/chunks/user-storage.js?id=2c5f4cdd17574255ea05",
|
||||
"/chunks/user-subscription.js": "/chunks/user-subscription.js?id=d6683735de17fd8c55c8",
|
||||
"/chunks/users.js": "/chunks/users.js?id=f2359ae7c0c166001c33"
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
}
|
||||
},
|
||||
created() {
|
||||
axios.get('/api/public/pricing')
|
||||
axios.get('/api/pricing')
|
||||
.then(response => {
|
||||
this.plans = response.data
|
||||
this.$emit('load', response.data)
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
}
|
||||
},
|
||||
created() {
|
||||
axios.get('/api/public/pricing')
|
||||
axios.get('/api/pricing')
|
||||
.then(response => {
|
||||
this.plans = response.data.filter(plan => {
|
||||
return plan.data.attributes.capacity > this.user.data.attributes.storage_capacity
|
||||
|
||||
10
resources/js/store/modules/fileBrowser.js
vendored
10
resources/js/store/modules/fileBrowser.js
vendored
@@ -77,7 +77,7 @@ const actions = {
|
||||
})
|
||||
|
||||
axios
|
||||
.get(getters.api + '/latest' )
|
||||
.get(getters.api + '/browse/latest' )
|
||||
.then(response => {
|
||||
commit('LOADING_STATE', {loading: false, data: response.data})
|
||||
events.$emit('scrollTop')
|
||||
@@ -98,7 +98,7 @@ const actions = {
|
||||
commit('STORE_CURRENT_FOLDER', currentFolder)
|
||||
|
||||
axios
|
||||
.get(getters.api + '/shared-all' + getters.sorting.URI)
|
||||
.get(getters.api + '/browse/shared-all' + getters.sorting.URI)
|
||||
.then(response => {
|
||||
commit('LOADING_STATE', {loading: false, data: response.data})
|
||||
commit('STORE_PREVIOUS_FOLDER', currentFolder)
|
||||
@@ -118,7 +118,7 @@ const actions = {
|
||||
})
|
||||
|
||||
axios
|
||||
.get(getters.api + '/participant-uploads' + getters.sorting.URI)
|
||||
.get(getters.api + '/browse/participant-uploads' + getters.sorting.URI)
|
||||
.then(response => {
|
||||
commit('LOADING_STATE', {loading: false, data: response.data})
|
||||
|
||||
@@ -160,7 +160,7 @@ const actions = {
|
||||
else if (getters.sharedDetail && !getters.sharedDetail.protected)
|
||||
route = '/api/search/public/' + router.currentRoute.params.token
|
||||
else
|
||||
route = '/api/search'
|
||||
route = '/api/browse/search'
|
||||
|
||||
axios
|
||||
.get(route, {
|
||||
@@ -183,7 +183,7 @@ const actions = {
|
||||
else if (getters.sharedDetail && !getters.sharedDetail.protected)
|
||||
route = '/api/navigation/public/' + router.currentRoute.params.token
|
||||
else
|
||||
route = '/api/navigation'
|
||||
route = '/api/browse/navigation'
|
||||
|
||||
axios
|
||||
.get(route + getters.sorting.URI)
|
||||
|
||||
4
resources/js/store/modules/fileFunctions.js
vendored
4
resources/js/store/modules/fileFunctions.js
vendored
@@ -291,7 +291,7 @@ const actions = {
|
||||
commit('CLEAR_FILEINFO_DETAIL')
|
||||
|
||||
axios
|
||||
.post(getters.api + '/restore-items', {
|
||||
.post(getters.api + '/trash/restore-items', {
|
||||
to_home: restoreToHome,
|
||||
data: itemToRestore
|
||||
})
|
||||
@@ -386,7 +386,7 @@ const actions = {
|
||||
commit('LOADING_STATE', { loading: true, data: [] })
|
||||
|
||||
axios
|
||||
.post(getters.api + '/empty-trash', {
|
||||
.post(getters.api + '/trash/empty-trash', {
|
||||
_method: 'delete'
|
||||
})
|
||||
.then(() => {
|
||||
|
||||
4
resources/js/store/modules/userAuth.js
vendored
4
resources/js/store/modules/userAuth.js
vendored
@@ -48,7 +48,7 @@ const actions = {
|
||||
}, 300)
|
||||
|
||||
axios
|
||||
.get(getters.api + '/logout')
|
||||
.get(getters.api + '/user/logout')
|
||||
.then(() => {
|
||||
clearTimeout(popup)
|
||||
commit('DESTROY_DATA')
|
||||
@@ -93,7 +93,7 @@ const actions = {
|
||||
context.commit('ADD_TO_FAVOURITES', pushToFavorites)
|
||||
|
||||
axios
|
||||
.post(context.getters.api + '/folders/favourites', {
|
||||
.post(context.getters.api + '/browse/folders/favourites', {
|
||||
folders: addFavourites
|
||||
})
|
||||
.catch(() => {
|
||||
|
||||
@@ -157,7 +157,7 @@
|
||||
|
||||
this.isFlushingCache = true
|
||||
|
||||
axios.get('/api/flush-cache')
|
||||
axios.get('/api/settings/flush-cache')
|
||||
.then(() => {
|
||||
events.$emit('toaster', {
|
||||
type: 'success',
|
||||
|
||||
@@ -452,7 +452,7 @@
|
||||
created() {
|
||||
|
||||
// Get setup intent for stripe
|
||||
axios.get('/api/stripe/setup-intent')
|
||||
axios.get('/api/subscription/setup-intent')
|
||||
.then(response => {
|
||||
this.clientSecret = response.data.client_secret
|
||||
})
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
document.head.appendChild(StripeElementsScript)
|
||||
|
||||
// Get setup intent for stripe
|
||||
axios.get('/api/stripe/setup-intent')
|
||||
axios.get('/api/subscription/setup-intent')
|
||||
.then(response => {
|
||||
this.clientSecret = response.data.client_secret
|
||||
|
||||
|
||||
304
routes/api.php
304
routes/api.php
@@ -10,190 +10,220 @@
|
||||
|
|
||||
*/
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Public API Routes
|
||||
|--------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
// Setup Wizard
|
||||
Route::group(['middleware' => ['api'], 'prefix' => 'setup'], function () {
|
||||
Route::post('/purchase-code', 'General\SetupWizardController@verify_purchase_code');
|
||||
Route::post('/database', 'General\SetupWizardController@setup_database');
|
||||
|
||||
Route::post('/stripe-credentials', 'General\SetupWizardController@store_stripe_credentials');
|
||||
Route::post('/stripe-billings', 'General\SetupWizardController@store_stripe_billings');
|
||||
Route::post('/stripe-plans', 'General\SetupWizardController@store_stripe_plans');
|
||||
|
||||
Route::post('/environment-setup', 'General\SetupWizardController@store_environment_setup');
|
||||
Route::post('/app-setup', 'General\SetupWizardController@store_app_settings');
|
||||
Route::post('/admin-setup', 'General\SetupWizardController@create_admin_account');
|
||||
});
|
||||
|
||||
// Upgrade App
|
||||
Route::group(['middleware' => ['api'], 'prefix' => 'upgrade'], function () {
|
||||
Route::post('/app', 'General\UpgradeAppController@upgrade');
|
||||
});
|
||||
|
||||
// Plans
|
||||
Route::group(['middleware' => ['api'], 'prefix' => 'public'], function () {
|
||||
Route::get('/pricing', 'General\PricingController@index');
|
||||
});
|
||||
use App\Http\Controllers\Admin\DashboardController;
|
||||
use App\Http\Controllers\Admin\InvoiceController;
|
||||
use App\Http\Controllers\Admin\PagesController;
|
||||
use App\Http\Controllers\Admin\PlanController;
|
||||
use App\Http\Controllers\Admin\UserController;
|
||||
use App\Http\Controllers\AppFunctionsController;
|
||||
use App\Http\Controllers\Auth\AuthController;
|
||||
use App\Http\Controllers\Auth\ForgotPasswordController;
|
||||
use App\Http\Controllers\Auth\ResetPasswordController;
|
||||
use App\Http\Controllers\FileBrowser\BrowseController;
|
||||
use App\Http\Controllers\FileFunctions\EditItemsController;
|
||||
use App\Http\Controllers\FileFunctions\FavouriteController;
|
||||
use App\Http\Controllers\FileFunctions\ShareController;
|
||||
use App\Http\Controllers\FileFunctions\TrashController;
|
||||
use App\Http\Controllers\General\PricingController;
|
||||
use App\Http\Controllers\General\SetupWizardController;
|
||||
use App\Http\Controllers\Sharing\FileSharingController;
|
||||
use App\Http\Controllers\User\AccountController;
|
||||
use App\Http\Controllers\User\PaymentMethodsController;
|
||||
use App\Http\Controllers\User\SubscriptionController;
|
||||
|
||||
// Public routes
|
||||
Route::group(['middleware' => ['api']], function () {
|
||||
|
||||
// Edit Functions
|
||||
Route::patch('/rename-item/{unique_id}/public/{token}', 'FileFunctions\EditItemsController@guest_rename_item');
|
||||
Route::post('/create-folder/public/{token}', 'FileFunctions\EditItemsController@guest_create_folder');
|
||||
Route::post('/remove-item/public/{token}', 'FileFunctions\EditItemsController@guest_delete_item');
|
||||
Route::post('/zip/public/{token}', 'FileFunctions\EditItemsController@guest_zip_multiple_files');
|
||||
Route::get('/zip-folder/{unique_id}/public/{token}', 'FileFunctions\EditItemsController@guest_zip_folder');
|
||||
Route::post('/upload/public/{token}', 'FileFunctions\EditItemsController@guest_upload');
|
||||
Route::post('/move/public/{token}', 'FileFunctions\EditItemsController@guest_move');
|
||||
Route::patch('/rename-item/{unique_id}/public/{token}', [EditItemsController::class, 'guest_rename_item']);
|
||||
Route::post('/create-folder/public/{token}', [EditItemsController::class, 'guest_create_folder']);
|
||||
Route::post('/remove-item/public/{token}', [EditItemsController::class, 'guest_delete_item']);
|
||||
Route::post('/zip/public/{token}', [EditItemsController::class, 'guest_zip_multiple_files']);
|
||||
Route::get('/zip-folder/{unique_id}/public/{token}', [EditItemsController::class, 'guest_zip_folder']);
|
||||
Route::post('/upload/public/{token}', [EditItemsController::class, 'guest_upload']);
|
||||
Route::post('/move/public/{token}', [EditItemsController::class, 'guest_move']);
|
||||
|
||||
// Sharing page browsing
|
||||
Route::get('/folders/{unique_id}/public/{token}', 'Sharing\FileSharingController@get_public_folders');
|
||||
Route::get('/navigation/public/{token}', 'Sharing\FileSharingController@get_public_navigation_tree');
|
||||
Route::post('/shared/authenticate/{token}', 'Sharing\FileSharingController@authenticate');
|
||||
Route::get('/search/public/{token}', 'Sharing\FileSharingController@search_public');
|
||||
Route::get('/files/{token}/public', 'Sharing\FileSharingController@file_public');
|
||||
Route::get('/shared/{token}', 'FileFunctions\ShareController@show');
|
||||
|
||||
// User reset password
|
||||
Route::post('/password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail');
|
||||
Route::post('/password/reset', 'Auth\ResetPasswordController@reset');
|
||||
|
||||
// User authentication
|
||||
Route::post('/user/check', 'Auth\AuthController@check_account');
|
||||
Route::post('/user/register', 'Auth\AuthController@register');
|
||||
Route::post('/user/login', 'Auth\AuthController@login');
|
||||
Route::get('/folders/{unique_id}/public/{token}', [FileSharingController::class, 'get_public_folders']);
|
||||
Route::get('/navigation/public/{token}', [FileSharingController::class, 'get_public_navigation_tree']);
|
||||
Route::post('/shared/authenticate/{token}', [FileSharingController::class, 'authenticate']);
|
||||
Route::get('/search/public/{token}', [FileSharingController::class, 'search_public']);
|
||||
Route::get('/files/{token}/public', [FileSharingController::class, 'file_public']);
|
||||
Route::get('/shared/{token}', [ShareController::class, 'show']);
|
||||
|
||||
// Pages
|
||||
Route::post('/contact', 'AppFunctionsController@contact_form');
|
||||
Route::get('/page/{slug}', 'AppFunctionsController@get_page');
|
||||
Route::get('/content', 'AppFunctionsController@get_settings');
|
||||
Route::post('/contact', [AppFunctionsController::class, 'contact_form']);
|
||||
Route::get('/page/{slug}', [AppFunctionsController::class, 'get_page']);
|
||||
Route::get('/content', [AppFunctionsController::class, 'get_settings']);
|
||||
|
||||
// Stripe
|
||||
Route::get('/pricing', [PricingController::class, 'index']);
|
||||
|
||||
// Password
|
||||
Route::group(['prefix' => 'password'], function () {
|
||||
Route::post('/email', [ForgotPasswordController::class, 'sendResetLinkEmail']);
|
||||
Route::post('/reset', [ResetPasswordController::class, 'reset']);
|
||||
});
|
||||
|
||||
// User
|
||||
Route::group(['prefix' => '/user'], function () {
|
||||
Route::post('/check', [AuthController::class, 'check_account']);
|
||||
Route::post('/register', [AuthController::class, 'register']);
|
||||
Route::post('/login', [AuthController::class, 'login']);
|
||||
});
|
||||
|
||||
// Setup Wizard
|
||||
Route::group(['prefix' => 'setup'], function () {
|
||||
Route::post('/purchase-code', [SetupWizardController::class, 'verify_purchase_code']);
|
||||
Route::post('/database', [SetupWizardController::class, 'setup_database']);
|
||||
Route::post('/stripe-credentials', [SetupWizardController::class, 'store_stripe_credentials']);
|
||||
Route::post('/stripe-billings', [SetupWizardController::class, 'store_stripe_billings']);
|
||||
Route::post('/stripe-plans', [SetupWizardController::class, 'store_stripe_plans']);
|
||||
Route::post('/environment-setup', [SetupWizardController::class, 'store_environment_setup']);
|
||||
Route::post('/app-setup', [SetupWizardController::class, 'store_app_settings']);
|
||||
Route::post('/admin-setup', [SetupWizardController::class, 'create_admin_account']);
|
||||
});
|
||||
});
|
||||
|
||||
// User master Routes
|
||||
Route::group(['middleware' => ['auth:api', 'auth.master', 'scope:master']], function () {
|
||||
|
||||
// User
|
||||
Route::patch('/user/relationships/settings', 'User\AccountController@update_user_settings');
|
||||
Route::post('/user/password', 'User\AccountController@change_password');
|
||||
Route::patch('/user/profile', 'User\AccountController@update_profile');
|
||||
Route::get('/user/subscription', 'User\SubscriptionController@show');
|
||||
Route::get('/user/invoices', 'User\AccountController@invoices');
|
||||
Route::get('/user/storage', 'User\AccountController@storage');
|
||||
Route::get('/user', 'User\AccountController@user');
|
||||
|
||||
// Payment cards
|
||||
Route::delete('/user/payment-cards/{id}', 'User\PaymentMethodsController@delete');
|
||||
Route::patch('/user/payment-cards/{id}', 'User\PaymentMethodsController@update');
|
||||
Route::post('/user/payment-cards', 'User\PaymentMethodsController@store');
|
||||
Route::get('/user/payments', 'User\PaymentMethodsController@index');
|
||||
|
||||
// Subscription
|
||||
Route::get('/stripe/setup-intent', 'User\SubscriptionController@stripe_setup_intent');
|
||||
Route::post('/subscription/upgrade', 'User\SubscriptionController@upgrade');
|
||||
Route::post('/subscription/cancel', 'User\SubscriptionController@cancel');
|
||||
Route::post('/subscription/resume', 'User\SubscriptionController@resume');
|
||||
Route::group(['middleware' => ['auth:sanctum']], function () {
|
||||
|
||||
// Browse
|
||||
Route::get('/participant-uploads', 'FileBrowser\BrowseController@participant_uploads');
|
||||
Route::get('/navigation', 'FileBrowser\BrowseController@navigation_tree');
|
||||
Route::get('/folders/{unique_id}', 'FileBrowser\BrowseController@folder');
|
||||
Route::get('/shared-all', 'FileBrowser\BrowseController@shared');
|
||||
Route::get('/latest', 'FileBrowser\BrowseController@latest');
|
||||
Route::get('/search', 'FileBrowser\BrowseController@search');
|
||||
Route::get('/trash', 'FileBrowser\BrowseController@trash');
|
||||
Route::group(['prefix' => 'browse'], function () {
|
||||
Route::get('/participant-uploads', [BrowseController::class, 'participant_uploads']);
|
||||
Route::get('/navigation', [BrowseController::class, 'navigation_tree']);
|
||||
Route::get('/folders/{unique_id}', [BrowseController::class, 'folder']);
|
||||
Route::get('/shared-all', [BrowseController::class, 'shared']);
|
||||
Route::get('/latest', [BrowseController::class, 'latest']);
|
||||
Route::get('/search', [BrowseController::class, 'search']);
|
||||
});
|
||||
|
||||
// Trash
|
||||
Route::post('/restore-items', 'FileFunctions\TrashController@restore');
|
||||
Route::delete('/empty-trash', 'FileFunctions\TrashController@clear');
|
||||
Route::group(['prefix' => 'trash'], function () {
|
||||
Route::post('/restore-items', [TrashController::class, 'restore']);
|
||||
Route::delete('/empty-trash', [TrashController::class, 'clear']);
|
||||
Route::get('/', [BrowseController::class, 'trash']);
|
||||
});
|
||||
|
||||
// Subscription
|
||||
Route::group(['prefix' => 'subscription'], function () {
|
||||
Route::get('/setup-intent', [SubscriptionController::class, 'stripe_setup_intent']);
|
||||
Route::post('/upgrade', [SubscriptionController::class, 'upgrade']);
|
||||
Route::post('/cancel', [SubscriptionController::class, 'cancel']);
|
||||
Route::post('/resume', [SubscriptionController::class, 'resume']);
|
||||
});
|
||||
|
||||
// Favourites
|
||||
Route::delete('/folders/favourites/{unique_id}', 'FileFunctions\FavouriteController@destroy');
|
||||
Route::post('/folders/favourites', 'FileFunctions\FavouriteController@store');
|
||||
Route::group(['prefix' => 'folders'], function () {
|
||||
Route::delete('/favourites/{unique_id}', [FavouriteController::class, 'destroy']);
|
||||
Route::post('/favourites', [FavouriteController::class, 'store']);
|
||||
});
|
||||
|
||||
// User
|
||||
Route::group(['prefix' => 'user'], function () {
|
||||
Route::patch('/relationships/settings', [AccountController::class, 'update_user_settings']);
|
||||
Route::post('/password', [AccountController::class, 'change_password']);
|
||||
Route::patch('/profile', [AccountController::class, 'update_profile']);
|
||||
Route::get('/subscription', [SubscriptionController::class, 'show']);
|
||||
Route::get('/invoices', [AccountController::class, 'invoices']);
|
||||
Route::get('/storage', [AccountController::class, 'storage']);
|
||||
Route::get('/logout', [AuthController::class, 'logout']);
|
||||
Route::get('/', [AccountController::class, 'user']);
|
||||
|
||||
// Payment cards
|
||||
Route::delete('/payment-cards/{id}', [PaymentMethodsController::class, 'delete']);
|
||||
Route::patch('/payment-cards/{id}', [PaymentMethodsController::class, 'update']);
|
||||
Route::post('/payment-cards', [PaymentMethodsController::class, 'store']);
|
||||
Route::get('/payments', [PaymentMethodsController::class, 'index']);
|
||||
});
|
||||
|
||||
// Share
|
||||
Route::post('/share/{token}/send-email', 'FileFunctions\ShareController@shared_send_via_email');
|
||||
Route::post('/share/cancel', 'FileFunctions\ShareController@destroy');
|
||||
Route::patch('/share/{token}', 'FileFunctions\ShareController@update');
|
||||
Route::post('/share', 'FileFunctions\ShareController@store');
|
||||
|
||||
// Auth
|
||||
Route::get('/logout', 'Auth\AuthController@logout');
|
||||
Route::group(['prefix' => 'share'], function () {
|
||||
Route::post('/{token}/send-email', [ShareController::class, 'shared_send_via_email']);
|
||||
Route::post('/cancel', [ShareController::class, 'destroy']);
|
||||
Route::patch('/{token}', [ShareController::class, 'update']);
|
||||
Route::post('/', [ShareController::class, 'store']);
|
||||
});
|
||||
});
|
||||
|
||||
// Admin
|
||||
Route::group(['middleware' => ['auth:api', 'auth.master', 'auth.admin', 'scope:master']], function () {
|
||||
|
||||
// Admin
|
||||
Route::get('/dashboard', 'Admin\DashboardController@index');
|
||||
Route::get('/dashboard/new-users', 'Admin\DashboardController@new_registrations');
|
||||
Route::group(['prefix' => 'dashboard'], function () {
|
||||
Route::get('/', [DashboardController::class, 'index']);
|
||||
Route::get('/new-users', [DashboardController::class, 'new_registrations']);
|
||||
});
|
||||
|
||||
// Get users info
|
||||
Route::get('/users/{id}/subscription', 'Admin\UserController@subscription');
|
||||
Route::get('/users/{id}/storage', 'Admin\UserController@storage');
|
||||
Route::get('/users/{id}/detail', 'Admin\UserController@details');
|
||||
Route::get('/users', 'Admin\UserController@users');
|
||||
|
||||
// Edit users
|
||||
Route::post('/users/{id}/send-password-email', 'Admin\UserController@send_password_reset_email');
|
||||
Route::patch('/users/{id}/capacity', 'Admin\UserController@change_storage_capacity');
|
||||
Route::delete('/users/{id}/delete', 'Admin\UserController@delete_user');
|
||||
Route::patch('/users/{id}/role', 'Admin\UserController@change_role');
|
||||
Route::get('/users/{id}/invoices', 'Admin\UserController@invoices');
|
||||
Route::post('/users/create', 'Admin\UserController@create_user');
|
||||
// Users
|
||||
Route::group(['prefix' => 'users'], function () {
|
||||
Route::post('/{id}/send-password-email', [UserController::class, 'send_password_reset_email']);
|
||||
Route::patch('/{id}/capacity', [UserController::class, 'change_storage_capacity']);
|
||||
Route::get('/{id}/subscription', [UserController::class, 'subscription']);
|
||||
Route::delete('/{id}/delete', [UserController::class, 'delete_user']);
|
||||
Route::patch('/{id}/role', [UserController::class, 'change_role']);
|
||||
Route::get('/{id}/invoices', [UserController::class, 'invoices']);
|
||||
Route::get('/{id}/storage', [UserController::class, 'storage']);
|
||||
Route::post('/create', [UserController::class, 'create_user']);
|
||||
Route::get('/{id}/detail', [UserController::class, 'details']);
|
||||
Route::get('/', [UserController::class, 'users']);
|
||||
});
|
||||
|
||||
// Plans
|
||||
Route::get('/plans/{id}/subscribers', 'Admin\PlanController@subscribers');
|
||||
Route::patch('/plans/{id}/update', 'Admin\PlanController@update');
|
||||
Route::delete('/plans/{id}', 'Admin\PlanController@delete');
|
||||
Route::post('/plans/store', 'Admin\PlanController@store');
|
||||
Route::get('/plans/{id}', 'Admin\PlanController@show');
|
||||
Route::get('/plans', 'Admin\PlanController@index');
|
||||
Route::group(['prefix' => 'plans'], function () {
|
||||
Route::get('/{id}/subscribers', [PlanController::class, 'subscribers']);
|
||||
Route::patch('/{id}/update', [PlanController::class, 'update']);
|
||||
Route::delete('/{id}', [PlanController::class, 'delete']);
|
||||
Route::post('/store', [PlanController::class, 'store']);
|
||||
Route::get('/{id}', [PlanController::class, 'show']);
|
||||
Route::get('/', [PlanController::class, 'index']);
|
||||
});
|
||||
|
||||
// Pages
|
||||
Route::get('/pages', 'Admin\PagesController@index');
|
||||
Route::get('/pages/{slug}', 'Admin\PagesController@show');
|
||||
Route::patch('/pages/{slug}', 'Admin\PagesController@update');
|
||||
Route::group(['prefix' => 'pages'], function () {
|
||||
Route::patch('/{slug}', [PagesController::class, 'update']);
|
||||
Route::get('/{slug}', [PagesController::class, 'show']);
|
||||
Route::get('/', [PagesController::class, 'index']);
|
||||
});
|
||||
|
||||
// Invoices
|
||||
Route::get('/invoices/{token}', 'Admin\InvoiceController@show');
|
||||
Route::get('/invoices', 'Admin\InvoiceController@index');
|
||||
Route::group(['prefix' => 'invoices'], function () {
|
||||
Route::get('/{token}', [InvoiceController::class, 'show']);
|
||||
Route::get('/', [InvoiceController::class, 'index']);
|
||||
});
|
||||
|
||||
// Settings
|
||||
Route::post('/settings/email', 'SettingController@set_email');
|
||||
Route::post('/settings/stripe', 'SettingController@set_stripe');
|
||||
Route::patch('/settings', 'SettingController@update');
|
||||
Route::get('/settings', 'SettingController@show');
|
||||
Route::get('/flush-cache', 'AppFunctionsController@flush_cache');
|
||||
Route::group(['prefix' => 'settings'], function () {
|
||||
Route::post('/email', [InvoiceController::class, 'set_email']);
|
||||
Route::post('/stripe', [InvoiceController::class, 'set_stripe']);
|
||||
Route::patch('/', [InvoiceController::class, 'update']);
|
||||
Route::get('/', [InvoiceController::class, 'show']);
|
||||
Route::get('/flush-cache', [AppFunctionsController::class, 'flush_cache']);
|
||||
});
|
||||
});
|
||||
|
||||
// Protected sharing routes for authenticated user
|
||||
Route::group(['middleware' => ['auth:api', 'auth.shared', 'scope:visitor,editor']], function () {
|
||||
|
||||
// Browse folders & files
|
||||
Route::get('/folders/{unique_id}/private', 'Sharing\FileSharingController@get_private_folders');
|
||||
Route::get('/navigation/private', 'Sharing\FileSharingController@get_private_navigation_tree');
|
||||
Route::get('/search/private', 'Sharing\FileSharingController@search_private');
|
||||
Route::get('/files/private', 'Sharing\FileSharingController@file_private');
|
||||
Route::get('/folders/{unique_id}/private', [FileSharingController::class, 'get_private_folders']);
|
||||
Route::get('/navigation/private', [FileSharingController::class, 'get_private_navigation_tree']);
|
||||
Route::get('/search/private', [FileSharingController::class, 'search_private']);
|
||||
Route::get('/files/private', [FileSharingController::class, 'file_private']);
|
||||
});
|
||||
|
||||
// User master,editor routes
|
||||
Route::group(['middleware' => ['auth:api', 'auth.shared', 'auth.master', 'scope:master,editor']], function () {
|
||||
|
||||
// Edit items
|
||||
Route::patch('/rename-item/{unique_id}', 'FileFunctions\EditItemsController@user_rename_item');
|
||||
Route::post('/create-folder', 'FileFunctions\EditItemsController@user_create_folder');
|
||||
Route::post('/remove-item', 'FileFunctions\EditItemsController@user_delete_item');
|
||||
Route::post('/zip', 'FileFunctions\EditItemsController@user_zip_multiple_files');
|
||||
Route::get('/zip-folder/{unique_id}', 'FileFunctions\EditItemsController@user_zip_folder');
|
||||
Route::post('/upload', 'FileFunctions\EditItemsController@user_upload');
|
||||
Route::post('/move', 'FileFunctions\EditItemsController@user_move');
|
||||
Route::patch('/rename-item/{unique_id}', [EditItemsController::class, 'user_rename_item']);
|
||||
Route::post('/create-folder', [EditItemsController::class, 'user_create_folder']);
|
||||
Route::post('/remove-item', [EditItemsController::class, 'user_delete_item']);
|
||||
Route::post('/zip', [EditItemsController::class, 'user_zip_multiple_files']);
|
||||
Route::get('/zip-folder/{unique_id}', [EditItemsController::class, 'user_zip_folder']);
|
||||
Route::post('/upload', [EditItemsController::class, 'user_upload']);
|
||||
Route::post('/move', [EditItemsController::class, 'user_move']);
|
||||
|
||||
//Get Emojis List
|
||||
Route::get('/emojis-list', 'AppFunctionsController@get_emojis_list');
|
||||
Route::get('/emojis-list', [AppFunctionsController::class, 'get_emojis_list']);
|
||||
});
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
*/
|
||||
|
||||
// Stripe WebHook
|
||||
use App\Http\Controllers\General\UpgradeAppController;
|
||||
|
||||
Route::post('/stripe/webhook', 'WebhookController@handleWebhook');
|
||||
|
||||
// Deployment WebHook URL
|
||||
@@ -39,10 +41,10 @@ Route::group(['middleware' => ['auth:api', 'auth.master', 'scope:master']], func
|
||||
});
|
||||
|
||||
// Admin system tools
|
||||
Route::get('/service/upgrade', 'General\UpgradeAppController@upgrade');
|
||||
Route::group(['middleware' => ['auth:api', 'auth.master', 'auth.admin', 'scope:master'], 'prefix' => 'service'], function () {
|
||||
Route::get('/down', 'General\UpgradeAppController@down');
|
||||
Route::get('/up', 'General\UpgradeAppController@up');
|
||||
Route::post('/upgrade', [UpgradeAppController::class, 'upgrade']);
|
||||
Route::get('/down', [UpgradeAppController::class, 'down']);
|
||||
Route::get('/up', [UpgradeAppController::class, 'up']);
|
||||
});
|
||||
|
||||
// Get og site for web crawlers
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\User;
|
||||
use App\Models\User;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||
use Illuminate\Foundation\Testing\WithFaker;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
use Tests\TestCase;
|
||||
|
||||
class UserTest extends TestCase
|
||||
@@ -29,4 +30,76 @@ class UserTest extends TestCase
|
||||
'user_id' => $user->id,
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_register_user_via_public_api()
|
||||
{
|
||||
$this->postJson('/register', [
|
||||
'email' => 'john@doe.com',
|
||||
'password' => 'SecretPassword',
|
||||
'password_confirmation' => 'SecretPassword',
|
||||
'name' => 'John Doe',
|
||||
])->assertStatus(201);
|
||||
|
||||
$this->assertDatabaseHas('users', [
|
||||
'email' => 'john@doe.com',
|
||||
]);
|
||||
|
||||
$this->assertDatabaseHas('user_settings', [
|
||||
'name' => 'John Doe',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_login_user_via_post_request()
|
||||
{
|
||||
$user = User::factory(User::class)
|
||||
->create(['email' => 'john@doe.com']);
|
||||
|
||||
$this->postJson('/login', [
|
||||
'email' => $user->email,
|
||||
'password' => 'secret',
|
||||
])->assertStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_change_user_password_via_post_request()
|
||||
{
|
||||
$user = User::factory(User::class)
|
||||
->create();
|
||||
|
||||
Sanctum::actingAs($user);
|
||||
|
||||
$this->putJson('/user/password', [
|
||||
'current_password' => 'secret',
|
||||
'password' => 'VerySecretPassword',
|
||||
'password_confirmation' => 'VerySecretPassword',
|
||||
])->assertStatus(200);
|
||||
}
|
||||
|
||||
/**
|
||||
* @test
|
||||
*/
|
||||
public function it_update_user_settings()
|
||||
{
|
||||
$user = User::factory(User::class)
|
||||
->create();
|
||||
|
||||
Sanctum::actingAs($user);
|
||||
|
||||
$this->patchJson('/api/user/relationships/settings', [
|
||||
'name' => 'address',
|
||||
'value' => 'Jantar',
|
||||
])->assertStatus(204);
|
||||
|
||||
$this->assertDatabaseHas('user_settings', [
|
||||
'address' => 'Jantar',
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user