mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-05-13 08:45:01 +00:00
Fix backend code styling
This commit is contained in:
+1
-1
File diff suppressed because one or more lines are too long
@@ -408,11 +408,10 @@ class SetupDevEnvironment extends Command
|
|||||||
],
|
],
|
||||||
])
|
])
|
||||||
->each(function ($file) use ($user, $documents) {
|
->each(function ($file) use ($user, $documents) {
|
||||||
|
|
||||||
$basename = Str::random(12) . '-' . $file['basename'];
|
$basename = Str::random(12) . '-' . $file['basename'];
|
||||||
|
|
||||||
// Copy file into app storage
|
// Copy file into app storage
|
||||||
Storage::putFileAs("files/$user->id", storage_path("demo/documents/{$file['basename']}"), $basename, "private");
|
Storage::putFileAs("files/$user->id", storage_path("demo/documents/{$file['basename']}"), $basename, 'private');
|
||||||
|
|
||||||
// Create file record
|
// Create file record
|
||||||
File::create([
|
File::create([
|
||||||
@@ -439,14 +438,13 @@ class SetupDevEnvironment extends Command
|
|||||||
'name' => 'Software Licence',
|
'name' => 'Software Licence',
|
||||||
'basename' => 'Project Notes.pdf',
|
'basename' => 'Project Notes.pdf',
|
||||||
'mimetype' => 'pdf',
|
'mimetype' => 'pdf',
|
||||||
]
|
],
|
||||||
])
|
])
|
||||||
->each(function ($file) use ($user, $shared_folder) {
|
->each(function ($file) use ($user, $shared_folder) {
|
||||||
|
|
||||||
$basename = Str::random(12) . '-' . $file['basename'];
|
$basename = Str::random(12) . '-' . $file['basename'];
|
||||||
|
|
||||||
// Copy file into app storage
|
// Copy file into app storage
|
||||||
Storage::putFileAs("files/$user->id", storage_path("demo/documents/{$file['basename']}"), $basename, "private");
|
Storage::putFileAs("files/$user->id", storage_path("demo/documents/{$file['basename']}"), $basename, 'private');
|
||||||
|
|
||||||
// Create file record
|
// Create file record
|
||||||
File::create([
|
File::create([
|
||||||
@@ -501,11 +499,10 @@ class SetupDevEnvironment extends Command
|
|||||||
],
|
],
|
||||||
])
|
])
|
||||||
->each(function ($file) use ($user, $peters_files) {
|
->each(function ($file) use ($user, $peters_files) {
|
||||||
|
|
||||||
$basename = Str::random(12) . '-' . $file['basename'];
|
$basename = Str::random(12) . '-' . $file['basename'];
|
||||||
|
|
||||||
// Copy file into app storage
|
// Copy file into app storage
|
||||||
Storage::putFileAs("files/$user->id", storage_path("demo/documents/{$file['basename']}"), $basename, "private");
|
Storage::putFileAs("files/$user->id", storage_path("demo/documents/{$file['basename']}"), $basename, 'private');
|
||||||
|
|
||||||
// Create file record
|
// Create file record
|
||||||
File::create([
|
File::create([
|
||||||
@@ -529,11 +526,10 @@ class SetupDevEnvironment extends Command
|
|||||||
'Sphere Bound 3D Titles.mp4',
|
'Sphere Bound 3D Titles.mp4',
|
||||||
])
|
])
|
||||||
->each(function ($file) use ($user, $videohive) {
|
->each(function ($file) use ($user, $videohive) {
|
||||||
|
|
||||||
$basename = Str::random(12) . '-' . $file;
|
$basename = Str::random(12) . '-' . $file;
|
||||||
|
|
||||||
// Copy file into app storage
|
// Copy file into app storage
|
||||||
Storage::putFileAs("files/$user->id", storage_path("demo/video/$file"), $basename, "private");
|
Storage::putFileAs("files/$user->id", storage_path("demo/video/$file"), $basename, 'private');
|
||||||
|
|
||||||
// Create file record
|
// Create file record
|
||||||
File::create([
|
File::create([
|
||||||
@@ -554,11 +550,10 @@ class SetupDevEnvironment extends Command
|
|||||||
'Apple Watch App Video Promotion.mp4',
|
'Apple Watch App Video Promotion.mp4',
|
||||||
])
|
])
|
||||||
->each(function ($file) use ($user, $video) {
|
->each(function ($file) use ($user, $video) {
|
||||||
|
|
||||||
$basename = Str::random(12) . '-' . $file;
|
$basename = Str::random(12) . '-' . $file;
|
||||||
|
|
||||||
// Copy file into app storage
|
// Copy file into app storage
|
||||||
Storage::putFileAs("files/$user->id", storage_path("demo/video/$file"), $basename, "private");
|
Storage::putFileAs("files/$user->id", storage_path("demo/video/$file"), $basename, 'private');
|
||||||
|
|
||||||
// Create file record
|
// Create file record
|
||||||
File::create([
|
File::create([
|
||||||
@@ -579,11 +574,10 @@ class SetupDevEnvironment extends Command
|
|||||||
'D-Block & S-te-Fan - Bla Bla.mp3',
|
'D-Block & S-te-Fan - Bla Bla.mp3',
|
||||||
])
|
])
|
||||||
->each(function ($file) use ($user, $audio) {
|
->each(function ($file) use ($user, $audio) {
|
||||||
|
|
||||||
$basename = Str::random(12) . '-' . $file;
|
$basename = Str::random(12) . '-' . $file;
|
||||||
|
|
||||||
// Copy file into app storage
|
// Copy file into app storage
|
||||||
Storage::putFileAs("files/$user->id", storage_path("demo/audio/$file"), $basename, "private");
|
Storage::putFileAs("files/$user->id", storage_path("demo/audio/$file"), $basename, 'private');
|
||||||
|
|
||||||
// Create file record
|
// Create file record
|
||||||
File::create([
|
File::create([
|
||||||
@@ -615,12 +609,11 @@ class SetupDevEnvironment extends Command
|
|||||||
'You Are My Sunshine.jpg',
|
'You Are My Sunshine.jpg',
|
||||||
])
|
])
|
||||||
->each(function ($file) use ($user, $apartments) {
|
->each(function ($file) use ($user, $apartments) {
|
||||||
|
|
||||||
$basename = Str::random(12) . '-' . $file;
|
$basename = Str::random(12) . '-' . $file;
|
||||||
|
|
||||||
// Copy file into app storage
|
// Copy file into app storage
|
||||||
Storage::putFileAs("files/$user->id", storage_path("demo/images/memes/$file"), $basename, "private");
|
Storage::putFileAs("files/$user->id", storage_path("demo/images/memes/$file"), $basename, 'private');
|
||||||
Storage::putFileAs("files/$user->id", storage_path("demo/images/memes/thumbnail-$file"), "thumbnail-$basename", "private");
|
Storage::putFileAs("files/$user->id", storage_path("demo/images/memes/thumbnail-$file"), "thumbnail-$basename", 'private');
|
||||||
|
|
||||||
// Create file record
|
// Create file record
|
||||||
File::create([
|
File::create([
|
||||||
@@ -648,12 +641,11 @@ class SetupDevEnvironment extends Command
|
|||||||
'Kitchen Island.jpg',
|
'Kitchen Island.jpg',
|
||||||
])
|
])
|
||||||
->each(function ($file) use ($user, $apartments) {
|
->each(function ($file) use ($user, $apartments) {
|
||||||
|
|
||||||
$basename = Str::random(12) . '-' . $file;
|
$basename = Str::random(12) . '-' . $file;
|
||||||
|
|
||||||
// Copy file into app storage
|
// Copy file into app storage
|
||||||
Storage::putFileAs("files/$user->id", storage_path("demo/images/apartments/$file"), $basename, "private");
|
Storage::putFileAs("files/$user->id", storage_path("demo/images/apartments/$file"), $basename, 'private');
|
||||||
Storage::putFileAs("files/$user->id", storage_path("demo/images/apartments/thumbnail-$file"), "thumbnail-$basename", "private");
|
Storage::putFileAs("files/$user->id", storage_path("demo/images/apartments/thumbnail-$file"), "thumbnail-$basename", 'private');
|
||||||
|
|
||||||
// Create file record
|
// Create file record
|
||||||
File::create([
|
File::create([
|
||||||
@@ -685,12 +677,11 @@ class SetupDevEnvironment extends Command
|
|||||||
'Yellow Animal Eyes Fur.jpg',
|
'Yellow Animal Eyes Fur.jpg',
|
||||||
])
|
])
|
||||||
->each(function ($file) use ($user, $nature) {
|
->each(function ($file) use ($user, $nature) {
|
||||||
|
|
||||||
$basename = Str::random(12) . '-' . $file;
|
$basename = Str::random(12) . '-' . $file;
|
||||||
|
|
||||||
// Copy file into app storage
|
// Copy file into app storage
|
||||||
Storage::putFileAs("files/$user->id", storage_path("demo/images/nature/$file"), $basename, "private");
|
Storage::putFileAs("files/$user->id", storage_path("demo/images/nature/$file"), $basename, 'private');
|
||||||
Storage::putFileAs("files/$user->id", storage_path("demo/images/nature/thumbnail-$file"), "thumbnail-$basename", "private");
|
Storage::putFileAs("files/$user->id", storage_path("demo/images/nature/thumbnail-$file"), "thumbnail-$basename", 'private');
|
||||||
|
|
||||||
// Create file record
|
// Create file record
|
||||||
File::create([
|
File::create([
|
||||||
@@ -854,18 +845,18 @@ class SetupDevEnvironment extends Command
|
|||||||
[
|
[
|
||||||
'name' => 'billing_vat_number',
|
'name' => 'billing_vat_number',
|
||||||
'value' => '41241241234',
|
'value' => '41241241234',
|
||||||
]
|
],
|
||||||
])->each(function ($col) {
|
])->each(function ($col) {
|
||||||
Setting::forceCreate([
|
Setting::forceCreate([
|
||||||
'name' => $col['name'],
|
'name' => $col['name'],
|
||||||
'value' => $col['value']
|
'value' => $col['value'],
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Get system images
|
// Get system images
|
||||||
collect(['logo.svg', 'logo-horizontal.svg', 'favicon.png', 'og-image.jpg', 'touch-icon.png'])
|
collect(['logo.svg', 'logo-horizontal.svg', 'favicon.png', 'og-image.jpg', 'touch-icon.png'])
|
||||||
->each(function ($file) {
|
->each(function ($file) {
|
||||||
Storage::putFileAs("system", storage_path("demo/app/$file"), $file, "private");
|
Storage::putFileAs('system', storage_path("demo/app/$file"), $file, 'private');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -876,12 +867,12 @@ class SetupDevEnvironment extends Command
|
|||||||
{
|
{
|
||||||
// Migrate database
|
// Migrate database
|
||||||
$this->call('migrate:fresh', [
|
$this->call('migrate:fresh', [
|
||||||
'--force' => true
|
'--force' => true,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Generate app key
|
// Generate app key
|
||||||
$this->call('key:generate', [
|
$this->call('key:generate', [
|
||||||
'--force' => true
|
'--force' => true,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,15 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Console\Commands;
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use App\Models\User;
|
||||||
|
use App\Models\Setting;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
use App\Models\Oasis\Client;
|
use App\Models\Oasis\Client;
|
||||||
use App\Models\Oasis\Invoice;
|
use App\Models\Oasis\Invoice;
|
||||||
use App\Models\Setting;
|
|
||||||
use App\Models\User;
|
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Illuminate\Database\Eloquent\Factories\Sequence;
|
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Database\Eloquent\Factories\Sequence;
|
||||||
|
|
||||||
class SetupOasisEnvironment extends Command
|
class SetupOasisEnvironment extends Command
|
||||||
{
|
{
|
||||||
@@ -65,8 +64,8 @@ class SetupOasisEnvironment extends Command
|
|||||||
$hash = Str::random(12);
|
$hash = Str::random(12);
|
||||||
|
|
||||||
// Get invoice logo and stamp
|
// Get invoice logo and stamp
|
||||||
Storage::putFileAs("system", storage_path("demo/app/logo-horizontal.svg"), "{$hash}-logo-horizontal.svg", "private");
|
Storage::putFileAs('system', storage_path('demo/app/logo-horizontal.svg'), "{$hash}-logo-horizontal.svg", 'private');
|
||||||
Storage::putFileAs("system", storage_path("demo/oasis/stamp.png"), "{$hash}-stamp.png", "private");
|
Storage::putFileAs('system', storage_path('demo/oasis/stamp.png'), "{$hash}-stamp.png", 'private');
|
||||||
|
|
||||||
$profile = $user->invoiceProfile()->create([
|
$profile = $user->invoiceProfile()->create([
|
||||||
'company' => 'VueFileManager Inc.',
|
'company' => 'VueFileManager Inc.',
|
||||||
@@ -129,7 +128,6 @@ class SetupOasisEnvironment extends Command
|
|||||||
collect([$regular_invoices, $advance_invoices])
|
collect([$regular_invoices, $advance_invoices])
|
||||||
->collapse()
|
->collapse()
|
||||||
->each(function ($invoice) use ($user) {
|
->each(function ($invoice) use ($user) {
|
||||||
|
|
||||||
$this->info("Generating invoice id: $invoice->id");
|
$this->info("Generating invoice id: $invoice->id");
|
||||||
|
|
||||||
\PDF::loadView('oasis.invoices.invoice', [
|
\PDF::loadView('oasis.invoices.invoice', [
|
||||||
@@ -147,9 +145,9 @@ class SetupOasisEnvironment extends Command
|
|||||||
public function set_oasis_data()
|
public function set_oasis_data()
|
||||||
{
|
{
|
||||||
Setting::updateOrCreate([
|
Setting::updateOrCreate([
|
||||||
'name' => 'app_color'
|
'name' => 'app_color',
|
||||||
], [
|
], [
|
||||||
'value' => '#ae5fec'
|
'value' => '#ae5fec',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +1,22 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Controllers\Oasis;
|
namespace App\Http\Controllers\Oasis;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
use App\Http\Requests\Admin\CreateUserByAdmin;
|
|
||||||
use App\Http\Requests\Oasis\CreateOrderRequest;
|
|
||||||
use App\Http\Resources\UserResource;
|
|
||||||
use App\Models\User;
|
|
||||||
use App\Models\UserSettings;
|
|
||||||
use App\Notifications\Oasis\PaymentRequiredNotification;
|
|
||||||
use App\Services\Oasis\CzechRegisterSearchService;
|
|
||||||
use App\Services\StripeService;
|
|
||||||
use Hash;
|
use Hash;
|
||||||
use Illuminate\Contracts\Foundation\Application;
|
use Notification;
|
||||||
use Illuminate\Contracts\Routing\ResponseFactory;
|
use App\Models\User;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
use App\Models\UserSettings;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
use Illuminate\Support\Str;
|
use App\Services\StripeService;
|
||||||
use Notification;
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Http\Resources\UserResource;
|
||||||
|
use App\Http\Requests\Admin\CreateUserByAdmin;
|
||||||
|
use App\Http\Requests\Oasis\CreateOrderRequest;
|
||||||
|
use Illuminate\Contracts\Foundation\Application;
|
||||||
|
use Illuminate\Contracts\Routing\ResponseFactory;
|
||||||
|
use App\Services\Oasis\CzechRegisterSearchService;
|
||||||
|
use App\Notifications\Oasis\PaymentRequiredNotification;
|
||||||
|
|
||||||
class AdminController extends Controller
|
class AdminController extends Controller
|
||||||
{
|
{
|
||||||
@@ -90,7 +89,8 @@ class AdminController extends Controller
|
|||||||
));
|
));
|
||||||
|
|
||||||
return response(
|
return response(
|
||||||
new UserResource($newbie), 201
|
new UserResource($newbie),
|
||||||
|
201
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Controllers\Oasis;
|
namespace App\Http\Controllers\Oasis;
|
||||||
|
|
||||||
use App\Http\Requests\Oasis\StoreClientRequest;
|
|
||||||
use App\Http\Resources\Oasis\OasisClientCollection;
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
use App\Http\Resources\Oasis\OasisClientResource;
|
|
||||||
use App\Models\Oasis\Client;
|
|
||||||
use Auth;
|
use Auth;
|
||||||
use Illuminate\Contracts\Foundation\Application;
|
use App\Models\Oasis\Client;
|
||||||
use Illuminate\Contracts\Routing\ResponseFactory;
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Http\Requests\Oasis\StoreClientRequest;
|
||||||
|
use Illuminate\Contracts\Foundation\Application;
|
||||||
|
use App\Http\Resources\Oasis\OasisClientResource;
|
||||||
|
use Illuminate\Contracts\Routing\ResponseFactory;
|
||||||
|
use App\Http\Resources\Oasis\OasisClientCollection;
|
||||||
|
|
||||||
class ClientController extends Controller
|
class ClientController extends Controller
|
||||||
{
|
{
|
||||||
@@ -21,7 +20,8 @@ class ClientController extends Controller
|
|||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
return response(
|
return response(
|
||||||
new OasisClientCollection(Auth::user()->clients), 200
|
new OasisClientCollection(Auth::user()->clients),
|
||||||
|
200
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,7 +48,8 @@ class ClientController extends Controller
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
return response(
|
return response(
|
||||||
new OasisClientResource($client), 201
|
new OasisClientResource($client),
|
||||||
|
201
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,10 +71,9 @@ class ClientController extends Controller
|
|||||||
{
|
{
|
||||||
// Store image if exist
|
// Store image if exist
|
||||||
if ($request->hasFile($request->name)) {
|
if ($request->hasFile($request->name)) {
|
||||||
|
|
||||||
// Find and update image path
|
// Find and update image path
|
||||||
$client->update([
|
$client->update([
|
||||||
$request->name => store_avatar($request, $request->name)
|
$request->name => store_avatar($request, $request->name),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return response('Done', 204);
|
return response('Done', 204);
|
||||||
@@ -109,7 +109,8 @@ class ClientController extends Controller
|
|||||||
->get();
|
->get();
|
||||||
|
|
||||||
return response(
|
return response(
|
||||||
new OasisClientCollection($results), 200
|
new OasisClientCollection($results),
|
||||||
|
200
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,20 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Controllers\Oasis;
|
namespace App\Http\Controllers\Oasis;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
use Auth;
|
||||||
use App\Http\Requests\Oasis\StoreInvoiceRequest;
|
use Storage;
|
||||||
use App\Http\Resources\Oasis\OasisInvoiceCollection;
|
use Illuminate\Support\Str;
|
||||||
use App\Http\Resources\Oasis\OasisInvoiceResource;
|
|
||||||
use App\Models\Oasis\Client;
|
use App\Models\Oasis\Client;
|
||||||
use App\Models\Oasis\Invoice;
|
use App\Models\Oasis\Invoice;
|
||||||
use App\Notifications\Oasis\InvoiceDeliveryNotification;
|
use Illuminate\Http\Response;
|
||||||
use App\Notifications\SharedSendViaEmail;
|
use App\Http\Controllers\Controller;
|
||||||
use Auth;
|
use Illuminate\Support\Facades\Notification;
|
||||||
|
use App\Http\Requests\Oasis\StoreInvoiceRequest;
|
||||||
use Illuminate\Contracts\Foundation\Application;
|
use Illuminate\Contracts\Foundation\Application;
|
||||||
use Illuminate\Contracts\Routing\ResponseFactory;
|
use Illuminate\Contracts\Routing\ResponseFactory;
|
||||||
use Illuminate\Http\Response;
|
use App\Http\Resources\Oasis\OasisInvoiceResource;
|
||||||
use Illuminate\Support\Facades\Notification;
|
use App\Http\Resources\Oasis\OasisInvoiceCollection;
|
||||||
use Illuminate\Support\Str;
|
use App\Notifications\Oasis\InvoiceDeliveryNotification;
|
||||||
use Storage;
|
|
||||||
|
|
||||||
class InvoiceController extends Controller
|
class InvoiceController extends Controller
|
||||||
{
|
{
|
||||||
@@ -26,7 +24,8 @@ class InvoiceController extends Controller
|
|||||||
public function get_all_regular_invoices()
|
public function get_all_regular_invoices()
|
||||||
{
|
{
|
||||||
return response(
|
return response(
|
||||||
new OasisInvoiceCollection(Auth::user()->regularInvoices), 200
|
new OasisInvoiceCollection(Auth::user()->regularInvoices),
|
||||||
|
200
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,7 +35,8 @@ class InvoiceController extends Controller
|
|||||||
public function get_all_advance_invoices()
|
public function get_all_advance_invoices()
|
||||||
{
|
{
|
||||||
return response(
|
return response(
|
||||||
new OasisInvoiceCollection(Auth::user()->advanceInvoices), 200
|
new OasisInvoiceCollection(Auth::user()->advanceInvoices),
|
||||||
|
200
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -66,7 +66,8 @@ class InvoiceController extends Controller
|
|||||||
->get();
|
->get();
|
||||||
|
|
||||||
return response(
|
return response(
|
||||||
new OasisInvoiceCollection($results), 200
|
new OasisInvoiceCollection($results),
|
||||||
|
200
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,7 +124,8 @@ class InvoiceController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
return response(
|
return response(
|
||||||
new OasisInvoiceResource($invoice), 201
|
new OasisInvoiceResource($invoice),
|
||||||
|
201
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,7 +147,6 @@ class InvoiceController extends Controller
|
|||||||
private function getOrStoreClient(StoreInvoiceRequest $request)
|
private function getOrStoreClient(StoreInvoiceRequest $request)
|
||||||
{
|
{
|
||||||
if (! Str::isUuid($request->client) && $request->store_client) {
|
if (! Str::isUuid($request->client) && $request->store_client) {
|
||||||
|
|
||||||
return $request->user()
|
return $request->user()
|
||||||
->clients()
|
->clients()
|
||||||
->create([
|
->create([
|
||||||
|
|||||||
@@ -1,16 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Controllers\Oasis;
|
namespace App\Http\Controllers\Oasis;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
use App\Http\Resources\Oasis\InvoiceProfileResource;
|
|
||||||
use App\Models\Oasis\InvoiceProfile;
|
|
||||||
use App\Models\Setting;
|
|
||||||
use Auth;
|
use Auth;
|
||||||
use Illuminate\Contracts\Foundation\Application;
|
|
||||||
use Illuminate\Contracts\Routing\ResponseFactory;
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Models\Oasis\InvoiceProfile;
|
||||||
|
use Illuminate\Contracts\Foundation\Application;
|
||||||
|
use Illuminate\Contracts\Routing\ResponseFactory;
|
||||||
|
use App\Http\Resources\Oasis\InvoiceProfileResource;
|
||||||
|
|
||||||
class InvoiceProfileController extends Controller
|
class InvoiceProfileController extends Controller
|
||||||
{
|
{
|
||||||
@@ -20,9 +18,11 @@ class InvoiceProfileController extends Controller
|
|||||||
public function show()
|
public function show()
|
||||||
{
|
{
|
||||||
return response(
|
return response(
|
||||||
new InvoiceProfileResource(Auth::user()->invoiceProfile), 200
|
new InvoiceProfileResource(Auth::user()->invoiceProfile),
|
||||||
|
200
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return Application|ResponseFactory|Response
|
* @return Application|ResponseFactory|Response
|
||||||
@@ -52,7 +52,8 @@ class InvoiceProfileController extends Controller
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
return response(
|
return response(
|
||||||
new InvoiceProfileResource($profile), 201
|
new InvoiceProfileResource($profile),
|
||||||
|
201
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,12 +65,11 @@ class InvoiceProfileController extends Controller
|
|||||||
{
|
{
|
||||||
// Store image if exist
|
// Store image if exist
|
||||||
if ($request->hasFile($request->name)) {
|
if ($request->hasFile($request->name)) {
|
||||||
|
|
||||||
// Find and update image path
|
// Find and update image path
|
||||||
$request->user()
|
$request->user()
|
||||||
->invoiceProfile()
|
->invoiceProfile()
|
||||||
->update([
|
->update([
|
||||||
$request->name => store_system_image($request, $request->name)
|
$request->name => store_system_image($request, $request->name),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
return response('Done', 204);
|
return response('Done', 204);
|
||||||
|
|||||||
@@ -1,20 +1,17 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Controllers\Oasis;
|
namespace App\Http\Controllers\Oasis;
|
||||||
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
use App\Http\Requests\User\UpdateUserPasswordRequest;
|
|
||||||
use App\Http\Resources\Oasis\SubscriptionRequestResource;
|
|
||||||
use App\Http\Resources\PlanResource;
|
|
||||||
use App\Models\Oasis\SubscriptionRequest;
|
|
||||||
use App\Services\StripeService;
|
|
||||||
use Illuminate\Contracts\Foundation\Application;
|
|
||||||
use Illuminate\Contracts\Routing\ResponseFactory;
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Response;
|
use Illuminate\Http\Response;
|
||||||
|
use App\Services\StripeService;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\Cache;
|
|
||||||
use Illuminate\Support\Facades\Hash;
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
use App\Models\Oasis\SubscriptionRequest;
|
||||||
|
use Illuminate\Contracts\Foundation\Application;
|
||||||
|
use Illuminate\Contracts\Routing\ResponseFactory;
|
||||||
|
use App\Http\Requests\User\UpdateUserPasswordRequest;
|
||||||
|
use App\Http\Resources\Oasis\SubscriptionRequestResource;
|
||||||
|
|
||||||
class SubscriptionController extends Controller
|
class SubscriptionController extends Controller
|
||||||
{
|
{
|
||||||
@@ -32,7 +29,8 @@ class SubscriptionController extends Controller
|
|||||||
public function get_subscription_request(SubscriptionRequest $order)
|
public function get_subscription_request(SubscriptionRequest $order)
|
||||||
{
|
{
|
||||||
return response(
|
return response(
|
||||||
new SubscriptionRequestResource($order), 200
|
new SubscriptionRequestResource($order),
|
||||||
|
200
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,7 +60,6 @@ class SubscriptionController extends Controller
|
|||||||
{
|
{
|
||||||
// Make subscription from subscription request
|
// Make subscription from subscription request
|
||||||
if ($order->exists) {
|
if ($order->exists) {
|
||||||
|
|
||||||
// Create subscription
|
// Create subscription
|
||||||
$order->user
|
$order->user
|
||||||
->newSubscription('main', $order->requested_plan)
|
->newSubscription('main', $order->requested_plan)
|
||||||
@@ -126,7 +123,7 @@ class SubscriptionController extends Controller
|
|||||||
|
|
||||||
// Update status
|
// Update status
|
||||||
$order->update([
|
$order->update([
|
||||||
'status' => 'logged'
|
'status' => 'logged',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Log in user
|
// Log in user
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Requests\Oasis;
|
namespace App\Http\Requests\Oasis;
|
||||||
|
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Requests\Oasis;
|
namespace App\Http\Requests\Oasis;
|
||||||
|
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Requests\Oasis;
|
namespace App\Http\Requests\Oasis;
|
||||||
|
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Requests\Oasis;
|
namespace App\Http\Requests\Oasis;
|
||||||
|
|
||||||
use Illuminate\Foundation\Http\FormRequest;
|
use Illuminate\Foundation\Http\FormRequest;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Resources\Oasis;
|
namespace App\Http\Resources\Oasis;
|
||||||
|
|
||||||
use Illuminate\Http\Resources\Json\ResourceCollection;
|
use Illuminate\Http\Resources\Json\ResourceCollection;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Resources\Oasis;
|
namespace App\Http\Resources\Oasis;
|
||||||
|
|
||||||
use Illuminate\Http\Resources\Json\JsonResource;
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Resources\Oasis;
|
namespace App\Http\Resources\Oasis;
|
||||||
|
|
||||||
use Illuminate\Http\Resources\Json\ResourceCollection;
|
use Illuminate\Http\Resources\Json\ResourceCollection;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Resources\Oasis;
|
namespace App\Http\Resources\Oasis;
|
||||||
|
|
||||||
use Illuminate\Http\Resources\Json\JsonResource;
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Resources\Oasis;
|
namespace App\Http\Resources\Oasis;
|
||||||
|
|
||||||
use Illuminate\Http\Resources\Json\ResourceCollection;
|
use Illuminate\Http\Resources\Json\ResourceCollection;
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Resources\Oasis;
|
namespace App\Http\Resources\Oasis;
|
||||||
|
|
||||||
use Illuminate\Http\Resources\Json\JsonResource;
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||||||
use Illuminate\Support\Facades\Storage;
|
|
||||||
use Illuminate\Support\Str;
|
|
||||||
|
|
||||||
class OasisInvoiceResource extends JsonResource
|
class OasisInvoiceResource extends JsonResource
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Http\Resources\Oasis;
|
namespace App\Http\Resources\Oasis;
|
||||||
|
|
||||||
use App\Http\Resources\PlanResource;
|
|
||||||
use App\Http\Resources\PricingResource;
|
|
||||||
use App\Services\StripeService;
|
use App\Services\StripeService;
|
||||||
|
use App\Http\Resources\PricingResource;
|
||||||
use Illuminate\Http\Resources\Json\JsonResource;
|
use Illuminate\Http\Resources\Json\JsonResource;
|
||||||
use Illuminate\Support\Facades\Cache;
|
|
||||||
|
|
||||||
class SubscriptionRequestResource extends JsonResource
|
class SubscriptionRequestResource extends JsonResource
|
||||||
{
|
{
|
||||||
@@ -41,13 +38,13 @@ class SubscriptionRequestResource extends JsonResource
|
|||||||
'country' => $this->user->settings->country,
|
'country' => $this->user->settings->country,
|
||||||
'phone_number' => $this->user->settings->phone_number,
|
'phone_number' => $this->user->settings->phone_number,
|
||||||
'ico' => $this->user->settings->ico,
|
'ico' => $this->user->settings->ico,
|
||||||
]
|
],
|
||||||
]
|
],
|
||||||
],
|
],
|
||||||
'plan' => new PricingResource(
|
'plan' => new PricingResource(
|
||||||
resolve(StripeService::class)->getPlan($this->requested_plan)
|
resolve(StripeService::class)->getPlan($this->requested_plan)
|
||||||
),
|
),
|
||||||
]
|
],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ class UserResource extends JsonResource
|
|||||||
'timezone' => $this->settings->timezone,
|
'timezone' => $this->settings->timezone,
|
||||||
|
|
||||||
// OasisDrive
|
// OasisDrive
|
||||||
'payment_activation' => (integer) $this->settings->payment_activation
|
'payment_activation' => (integer) $this->settings->payment_activation,
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -84,7 +84,6 @@ function invoice_total_discount($invoice, $format = false)
|
|||||||
{
|
{
|
||||||
// Percent discount
|
// Percent discount
|
||||||
if ($invoice['discount_type'] === 'percent') {
|
if ($invoice['discount_type'] === 'percent') {
|
||||||
|
|
||||||
$discount = (int) (invoice_total_net($invoice) + invoice_total_tax($invoice)) * ($invoice['discount_rate'] / 100);
|
$discount = (int) (invoice_total_net($invoice) + invoice_total_tax($invoice)) * ($invoice['discount_rate'] / 100);
|
||||||
|
|
||||||
if ($format) {
|
if ($format) {
|
||||||
@@ -96,7 +95,6 @@ function invoice_total_discount($invoice, $format = false)
|
|||||||
|
|
||||||
// Value discount
|
// Value discount
|
||||||
if ($invoice['discount_type'] === 'value') {
|
if ($invoice['discount_type'] === 'value') {
|
||||||
|
|
||||||
if ($format) {
|
if ($format) {
|
||||||
return Cashier::formatAmount($invoice['discount_rate'] * 100, $invoice['currency'], 'cs');
|
return Cashier::formatAmount($invoice['discount_rate'] * 100, $invoice['currency'], 'cs');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -291,7 +291,6 @@ function store_avatar($request, $name)
|
|||||||
$image_path = Str::random(16) . '-' . $image->getClientOriginalName();
|
$image_path = Str::random(16) . '-' . $image->getClientOriginalName();
|
||||||
|
|
||||||
if (in_array($image->getClientMimeType(), ['image/gif', 'image/jpeg', 'image/jpg', 'image/png', 'image/webp'])) {
|
if (in_array($image->getClientMimeType(), ['image/gif', 'image/jpeg', 'image/jpg', 'image/png', 'image/webp'])) {
|
||||||
|
|
||||||
// Create intervention image
|
// Create intervention image
|
||||||
$img = Image::make($image->getRealPath());
|
$img = Image::make($image->getRealPath());
|
||||||
|
|
||||||
@@ -303,8 +302,7 @@ function store_avatar($request, $name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($image->getClientMimeType() === 'image/svg+xml') {
|
if ($image->getClientMimeType() === 'image/svg+xml') {
|
||||||
|
Storage::putFileAs('avatars', $image, $image_path);
|
||||||
Storage::putFileAs("avatars", $image, $image_path);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Return path to image
|
// Return path to image
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Models\Oasis;
|
namespace App\Models\Oasis;
|
||||||
|
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
|
||||||
use Illuminate\Support\Facades\Storage;
|
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Laravel\Scout\Searchable;
|
use Laravel\Scout\Searchable;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
use TeamTNT\TNTSearch\Indexer\TNTIndexer;
|
use TeamTNT\TNTSearch\Indexer\TNTIndexer;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @method static whereUserId($id)
|
* @method static whereUserId($id)
|
||||||
|
|||||||
@@ -1,16 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Models\Oasis;
|
namespace App\Models\Oasis;
|
||||||
|
|
||||||
use App\Models\User;
|
|
||||||
use Auth;
|
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use App\Models\User;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
|
||||||
use Illuminate\Support\Facades\Storage;
|
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
use Laravel\Scout\Searchable;
|
use Laravel\Scout\Searchable;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
use TeamTNT\TNTSearch\Indexer\TNTIndexer;
|
use TeamTNT\TNTSearch\Indexer\TNTIndexer;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
|
||||||
class Invoice extends Model
|
class Invoice extends Model
|
||||||
{
|
{
|
||||||
@@ -23,7 +21,7 @@ class Invoice extends Model
|
|||||||
];
|
];
|
||||||
|
|
||||||
public $guarded = [
|
public $guarded = [
|
||||||
'id'
|
'id',
|
||||||
];
|
];
|
||||||
|
|
||||||
public $incrementing = false;
|
public $incrementing = false;
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Models\Oasis;
|
namespace App\Models\Oasis;
|
||||||
|
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
|
||||||
class InvoiceProfile extends Model
|
class InvoiceProfile extends Model
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,19 +1,18 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Models\Oasis;
|
namespace App\Models\Oasis;
|
||||||
|
|
||||||
use App\Models\User;
|
|
||||||
use Auth;
|
use Auth;
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
use App\Models\User;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||||
|
|
||||||
class SubscriptionRequest extends Model
|
class SubscriptionRequest extends Model
|
||||||
{
|
{
|
||||||
use HasFactory;
|
use HasFactory;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'requested_plan', 'creator', 'status'
|
'requested_plan', 'creator', 'status',
|
||||||
];
|
];
|
||||||
|
|
||||||
public $incrementing = false;
|
public $incrementing = false;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use App\Traits\Oasis;
|
use App\Traits\Oasis;
|
||||||
@@ -18,7 +17,6 @@ use Illuminate\Foundation\Auth\User as Authenticatable;
|
|||||||
class User extends Authenticatable
|
class User extends Authenticatable
|
||||||
{
|
{
|
||||||
use Notifiable, Billable, Sortable, HasFactory, HasApiTokens;
|
use Notifiable, Billable, Sortable, HasFactory, HasApiTokens;
|
||||||
|
|
||||||
use Oasis;
|
use Oasis;
|
||||||
|
|
||||||
protected $guarded = [
|
protected $guarded = [
|
||||||
|
|||||||
@@ -1,12 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Notifications\Oasis;
|
namespace App\Notifications\Oasis;
|
||||||
|
|
||||||
use App\Models\Oasis\Invoice;
|
|
||||||
use Illuminate\Bus\Queueable;
|
use Illuminate\Bus\Queueable;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
||||||
use Illuminate\Notifications\Messages\MailMessage;
|
|
||||||
use Illuminate\Notifications\Notification;
|
use Illuminate\Notifications\Notification;
|
||||||
|
use Illuminate\Notifications\Messages\MailMessage;
|
||||||
|
|
||||||
class InvoiceDeliveryNotification extends Notification
|
class InvoiceDeliveryNotification extends Notification
|
||||||
{
|
{
|
||||||
@@ -51,7 +48,7 @@ class InvoiceDeliveryNotification extends Notification
|
|||||||
->greeting(__t('mail_greeting'))
|
->greeting(__t('mail_greeting'))
|
||||||
->line($this->user->settings->name . ' sent you an invoice.')
|
->line($this->user->settings->name . ' sent you an invoice.')
|
||||||
->salutation(__t('mail_salutation'))
|
->salutation(__t('mail_salutation'))
|
||||||
->attach(storage_path("app/" . invoice_path($this->invoice)), [
|
->attach(storage_path('app/' . invoice_path($this->invoice)), [
|
||||||
'as' => 'name.pdf',
|
'as' => 'name.pdf',
|
||||||
'mime' => 'application/pdf',
|
'mime' => 'application/pdf',
|
||||||
]);
|
]);
|
||||||
@@ -66,7 +63,6 @@ class InvoiceDeliveryNotification extends Notification
|
|||||||
public function toArray($notifiable)
|
public function toArray($notifiable)
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
//
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Notifications\Oasis;
|
namespace App\Notifications\Oasis;
|
||||||
|
|
||||||
use Illuminate\Bus\Queueable;
|
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
||||||
use Illuminate\Notifications\Messages\MailMessage;
|
|
||||||
use Illuminate\Notifications\Notification;
|
|
||||||
use Laravel\Cashier\Cashier;
|
use Laravel\Cashier\Cashier;
|
||||||
|
use Illuminate\Bus\Queueable;
|
||||||
|
use Illuminate\Notifications\Notification;
|
||||||
|
use Illuminate\Notifications\Messages\MailMessage;
|
||||||
|
|
||||||
class PaymentRequiredNotification extends Notification
|
class PaymentRequiredNotification extends Notification
|
||||||
{
|
{
|
||||||
@@ -69,7 +67,6 @@ class PaymentRequiredNotification extends Notification
|
|||||||
public function toArray($notifiable)
|
public function toArray($notifiable)
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
//
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Notifications\Oasis;
|
namespace App\Notifications\Oasis;
|
||||||
|
|
||||||
use Illuminate\Bus\Queueable;
|
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
||||||
use Illuminate\Notifications\Messages\MailMessage;
|
|
||||||
use Illuminate\Notifications\Notification;
|
|
||||||
use Laravel\Cashier\Cashier;
|
use Laravel\Cashier\Cashier;
|
||||||
|
use Illuminate\Bus\Queueable;
|
||||||
|
use Illuminate\Notifications\Notification;
|
||||||
|
use Illuminate\Notifications\Messages\MailMessage;
|
||||||
|
|
||||||
class ReminderForPaymentRequiredNotification extends Notification
|
class ReminderForPaymentRequiredNotification extends Notification
|
||||||
{
|
{
|
||||||
@@ -69,7 +67,6 @@ class ReminderForPaymentRequiredNotification extends Notification
|
|||||||
public function toArray($notifiable)
|
public function toArray($notifiable)
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
//
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,6 @@
|
|||||||
* $out = $connector->findByIco('44315945');
|
* $out = $connector->findByIco('44315945');
|
||||||
* echo ''.print_r($out, 1).'';
|
* echo ''.print_r($out, 1).'';
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace App\Services\Oasis;
|
namespace App\Services\Oasis;
|
||||||
|
|
||||||
class CzechRegisterSearchService
|
class CzechRegisterSearchService
|
||||||
@@ -85,8 +84,10 @@ class CzechRegisterSearchService
|
|||||||
if (preg_match('/^\d{8}$/', $ico)) {
|
if (preg_match('/^\d{8}$/', $ico)) {
|
||||||
$url = self::URL_SERVER . '?ico=' . $ico;
|
$url = self::URL_SERVER . '?ico=' . $ico;
|
||||||
$response = file_get_contents($url);
|
$response = file_get_contents($url);
|
||||||
|
|
||||||
if ($response) {
|
if ($response) {
|
||||||
$response = self::extractSubjects($response);
|
$response = self::extractSubjects($response);
|
||||||
|
|
||||||
if (! empty($response[0])) {
|
if (! empty($response[0])) {
|
||||||
$response = $response[0];
|
$response = $response[0];
|
||||||
}
|
}
|
||||||
@@ -96,7 +97,6 @@ class CzechRegisterSearchService
|
|||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return matched formatted for autocomplete dropdown list
|
* Return matched formatted for autocomplete dropdown list
|
||||||
* @param string $term Searched matching string
|
* @param string $term Searched matching string
|
||||||
@@ -117,7 +117,6 @@ class CzechRegisterSearchService
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (! empty($subjects) && is_array($subjects)) {
|
if (! empty($subjects) && is_array($subjects)) {
|
||||||
|
|
||||||
$subjects = array_slice($subjects, 0, $size); // return first $size matches
|
$subjects = array_slice($subjects, 0, $size); // return first $size matches
|
||||||
|
|
||||||
foreach ($subjects as &$subject) {
|
foreach ($subjects as &$subject) {
|
||||||
@@ -154,10 +153,10 @@ class CzechRegisterSearchService
|
|||||||
}
|
}
|
||||||
|
|
||||||
$tidy = new \tidy();
|
$tidy = new \tidy();
|
||||||
$html = $tidy->repairString($html, array(
|
$html = $tidy->repairString($html, [
|
||||||
'output-xhtml' => true,
|
'output-xhtml' => true,
|
||||||
'show-body-only' => true,
|
'show-body-only' => true,
|
||||||
), 'utf8');
|
], 'utf8');
|
||||||
|
|
||||||
// purify whitespaces - vkladaju \n alebo
|
// purify whitespaces - vkladaju \n alebo
|
||||||
$html = strtr($html, [
|
$html = strtr($html, [
|
||||||
@@ -174,11 +173,10 @@ class CzechRegisterSearchService
|
|||||||
$out = [];
|
$out = [];
|
||||||
|
|
||||||
if ($rows->length) {
|
if ($rows->length) {
|
||||||
|
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
|
|
||||||
// Nazev
|
// Nazev
|
||||||
$nodeList = $xpath->query("./tr[1]/td[1]", $row);
|
$nodeList = $xpath->query('./tr[1]/td[1]', $row);
|
||||||
|
|
||||||
if (! $nodeList->length) {
|
if (! $nodeList->length) {
|
||||||
continue; // nazev je povinny
|
continue; // nazev je povinny
|
||||||
}
|
}
|
||||||
@@ -186,14 +184,14 @@ class CzechRegisterSearchService
|
|||||||
$name = preg_replace('/\s+/', ' ', $name); // viacnasobne inside spaces
|
$name = preg_replace('/\s+/', ' ', $name); // viacnasobne inside spaces
|
||||||
|
|
||||||
// ICO
|
// ICO
|
||||||
$nodeList = $xpath->query("./tr[1]/td[2]", $row);
|
$nodeList = $xpath->query('./tr[1]/td[2]', $row);
|
||||||
$ico = $nodeList->length ? $nodeList->item(0)->nodeValue : '';
|
$ico = $nodeList->length ? $nodeList->item(0)->nodeValue : '';
|
||||||
|
|
||||||
// adresa - neda sa spolahnut na poradie prvkov :-(
|
// adresa - neda sa spolahnut na poradie prvkov :-(
|
||||||
$city = '';
|
$city = '';
|
||||||
$nodeList = $xpath->query("./tr[3]/td[1]", $row);
|
$nodeList = $xpath->query('./tr[3]/td[1]', $row);
|
||||||
if ($nodeList->length) {
|
|
||||||
|
|
||||||
|
if ($nodeList->length) {
|
||||||
$addr = trim($nodeList->item(0)->nodeValue);
|
$addr = trim($nodeList->item(0)->nodeValue);
|
||||||
|
|
||||||
if (preg_match('/,\s*(\d{3} ?\d{2})\s+(.+)$/', $addr, $match)) {
|
if (preg_match('/,\s*(\d{3} ?\d{2})\s+(.+)$/', $addr, $match)) {
|
||||||
@@ -209,6 +207,7 @@ class CzechRegisterSearchService
|
|||||||
} elseif (! preg_match('/\d{3} ?\d{2}/', $addr, $match)) {
|
} elseif (! preg_match('/\d{3} ?\d{2}/', $addr, $match)) {
|
||||||
// Ústí nad Labem, Masarykova 74 - bez PSC - obec, ulice a cislo
|
// Ústí nad Labem, Masarykova 74 - bez PSC - obec, ulice a cislo
|
||||||
$addr_streetnr = $addr_zip = '';
|
$addr_streetnr = $addr_zip = '';
|
||||||
|
|
||||||
if (false !== strpos($addr, ',')) {
|
if (false !== strpos($addr, ',')) {
|
||||||
list($city, $addr_streetnr) = explode(',', $addr);
|
list($city, $addr_streetnr) = explode(',', $addr);
|
||||||
} else {
|
} else {
|
||||||
@@ -251,5 +250,4 @@ class CzechRegisterSearchService
|
|||||||
{
|
{
|
||||||
return trim(strtr($s, ['"' => '', "'" => '']));
|
return trim(strtr($s, ['"' => '', "'" => '']));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,16 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
namespace App\Services\Oasis;
|
namespace App\Services\Oasis;
|
||||||
|
|
||||||
|
|
||||||
use App\Models\Oasis\Client;
|
|
||||||
use App\Models\Oasis\Invoice;
|
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use Illuminate\Contracts\Foundation\Application;
|
use App\Models\Oasis\Invoice;
|
||||||
use Illuminate\Contracts\View\Factory;
|
|
||||||
use Illuminate\Contracts\View\View;
|
use Illuminate\Contracts\View\View;
|
||||||
use Illuminate\Database\Eloquent\Factories\Sequence;
|
use Illuminate\Contracts\View\Factory;
|
||||||
|
use Illuminate\Contracts\Foundation\Application;
|
||||||
|
|
||||||
class OasisDevService
|
class OasisDevService
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,13 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
namespace App\Services\Oasis;
|
namespace App\Services\Oasis;
|
||||||
|
|
||||||
|
use Carbon\Carbon;
|
||||||
|
use App\Services\StripeService;
|
||||||
use App\Models\Oasis\SubscriptionRequest;
|
use App\Models\Oasis\SubscriptionRequest;
|
||||||
use App\Notifications\Oasis\ReminderForPaymentRequiredNotification;
|
use App\Notifications\Oasis\ReminderForPaymentRequiredNotification;
|
||||||
use App\Services\StripeService;
|
|
||||||
use Carbon\Carbon;
|
|
||||||
|
|
||||||
class OasisService
|
class OasisService
|
||||||
{
|
{
|
||||||
@@ -20,19 +17,18 @@ class OasisService
|
|||||||
SubscriptionRequest::whereStatus('requested')
|
SubscriptionRequest::whereStatus('requested')
|
||||||
->get()
|
->get()
|
||||||
->each(function ($request) {
|
->each(function ($request) {
|
||||||
|
|
||||||
// Get diffInHours
|
// Get diffInHours
|
||||||
$diff = Carbon::parse($request->created_at)
|
$diff = Carbon::parse($request->created_at)
|
||||||
->diffInHours(Carbon::now());
|
->diffInHours(Carbon::now());
|
||||||
|
|
||||||
// Send order reminder
|
// Send order reminder
|
||||||
if ($diff == 8) {
|
if ($diff == 8) {
|
||||||
|
|
||||||
$plan = resolve(StripeService::class)
|
$plan = resolve(StripeService::class)
|
||||||
->getPlan($request->requested_plan);
|
->getPlan($request->requested_plan);
|
||||||
|
|
||||||
$request->user->notify(new ReminderForPaymentRequiredNotification(
|
$request->user->notify(new ReminderForPaymentRequiredNotification(
|
||||||
$request, $plan
|
$request,
|
||||||
|
$plan
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ use Symfony\Component\HttpKernel\Exception\HttpException;
|
|||||||
|
|
||||||
class StripeService
|
class StripeService
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Stripe Service constructor.
|
* Stripe Service constructor.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Traits;
|
namespace App\Traits;
|
||||||
|
|
||||||
use App\Models\Oasis\Client;
|
use App\Models\Oasis\Client;
|
||||||
|
|||||||
@@ -83,5 +83,5 @@ return [
|
|||||||
'contact_documents_title' => 'Dokumenty',
|
'contact_documents_title' => 'Dokumenty',
|
||||||
'contact_leave_message_title' => 'Zanechte nám vzkaz',
|
'contact_leave_message_title' => 'Zanechte nám vzkaz',
|
||||||
|
|
||||||
'document_gdpr_policy' => 'Směrnice EU (GDPR)'
|
'document_gdpr_policy' => 'Směrnice EU (GDPR)',
|
||||||
];
|
];
|
||||||
+1
-2
@@ -1,7 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Snappy PDF / Image Configuration
|
| Snappy PDF / Image Configuration
|
||||||
@@ -39,7 +38,7 @@ return [
|
|||||||
'timeout' => false,
|
'timeout' => false,
|
||||||
'options' => [
|
'options' => [
|
||||||
'enable-local-file-access' => true,
|
'enable-local-file-access' => true,
|
||||||
'encoding' => 'UTF-8'
|
'encoding' => 'UTF-8',
|
||||||
],
|
],
|
||||||
'env' => [],
|
'env' => [],
|
||||||
],
|
],
|
||||||
|
|||||||
+2
-3
@@ -1,14 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Services\Oasis\OasisDevService;
|
||||||
use App\Http\Controllers\Oasis\AdminController;
|
use App\Http\Controllers\Oasis\AdminController;
|
||||||
use App\Http\Controllers\Oasis\ClientController;
|
use App\Http\Controllers\Oasis\ClientController;
|
||||||
use App\Http\Controllers\Oasis\InvoiceController;
|
use App\Http\Controllers\Oasis\InvoiceController;
|
||||||
use App\Http\Controllers\Oasis\InvoiceProfileController;
|
|
||||||
use App\Http\Controllers\Oasis\SubscriptionController;
|
use App\Http\Controllers\Oasis\SubscriptionController;
|
||||||
use App\Services\Oasis\OasisDevService;
|
use App\Http\Controllers\Oasis\InvoiceProfileController;
|
||||||
|
|
||||||
Route::group(['middleware' => 'api', 'prefix' => '/api/oasis'], function () {
|
Route::group(['middleware' => 'api', 'prefix' => '/api/oasis'], function () {
|
||||||
|
|
||||||
// Admin
|
// Admin
|
||||||
Route::group(['middleware' => 'auth:sanctum', 'prefix' => 'admin'], function () {
|
Route::group(['middleware' => 'auth:sanctum', 'prefix' => 'admin'], function () {
|
||||||
Route::get('/company-details', [AdminController::class, 'get_company_details']);
|
Route::get('/company-details', [AdminController::class, 'get_company_details']);
|
||||||
|
|||||||
Reference in New Issue
Block a user