add: full multi-tenancy control

This commit is contained in:
Cauê Faleiros
2026-02-02 15:31:15 -03:00
commit c6ec92802b
1711 changed files with 258106 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
<?php
namespace Webkul\Core\Contracts;
interface CoreConfig {}

View File

@@ -0,0 +1,5 @@
<?php
namespace Webkul\Core\Contracts;
interface Country {}

View File

@@ -0,0 +1,5 @@
<?php
namespace Webkul\Core\Contracts;
interface CountryState {}

View File

@@ -0,0 +1,30 @@
<?php
namespace Webkul\Core\Contracts\Validations;
use Illuminate\Contracts\Validation\Rule;
class Code implements Rule
{
/**
* Determine if the validation rule passes.
*
* @param string $attribute
* @param mixed $value
* @return bool
*/
public function passes($attribute, $value)
{
return preg_match('/^[a-zA-Z]+[a-zA-Z0-9_]+$/', $value);
}
/**
* Get the validation error message.
*
* @return string
*/
public function message()
{
return trans('core::app.validations.code');
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace Webkul\Core\Contracts\Validations;
use Closure;
use Illuminate\Contracts\Validation\ValidationRule;
class Decimal implements ValidationRule
{
/**
* Run the validation rule.
*
* @param \Closure(string): \Illuminate\Translation\PotentiallyTranslatedString $fail
*/
public function validate(string $attribute, mixed $value, Closure $fail): void
{
if (! preg_match('/^\d*(\.\d{1,4})?$/', $value)) {
$fail(trans('admin::app.validations.message.decimal', ['attribute' => $attribute]));
}
}
}