This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace App\Support; | |
abstract class AbstractValidator | |
{ | |
protected $errors; | |
/** | |
* handle checking data is valid | |
* @return boolean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Validators; | |
use App\Support\AbstractValidator; | |
class CreateItemDataValidator extends AbstractValidator | |
{ | |
/** | |
* handle checking data is valid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Validators; | |
class ValidationException extends \Exception | |
{ | |
public function __construct($message, $errors, $code = 0, \Exception $previous = null) | |
{ | |
$this->errors = $errros; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Infrastructure\Utilities; | |
class SystemUtil | |
{ | |
public static function maxFileUploadSize() | |
{ | |
//select maximum upload size | |
$maxUpload = self::getBytes(ini_get('upload_max_filesize')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const elixir = require('laravel-elixir'); | |
require('laravel-elixir-vue-2'); | |
/* | |
|-------------------------------------------------------------------------- | |
| Elixir Asset Management | |
|-------------------------------------------------------------------------- | |
| | |
| Elixir provides a clean, fluent API for defining some basic Gulp tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//app\Http\Middleware\Cors.php | |
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
class CorsMiddleware | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
use Auth; | |
use App\Models\Log; | |
use App\Services\RequestLogger; | |
class LogRequestMiddleware |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
protected $appends = [ | |
'created_at_ago', | |
'updated_at_ago' | |
]; | |
public function getCreatedAtAgoAttribute() { | |
return $this->created_at->diffForHumans(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Traits\User; | |
use App\Models\Role; | |
use App\Models\Permission; | |
use Illuminate\Database\Eloquent\ModelNotFoundException; | |
trait Roles { | |
public function roles() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Requests; | |
use Illuminate\Http\JsonResponse; | |
use Illuminate\Foundation\Http\FormRequest; | |
use Illuminate\Contracts\Validation\Validator; | |
use Illuminate\Http\Exception\HttpResponseException; | |
abstract class BaseRequest extends FormRequest | |
{ |