Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Laravel\Platforms\SuperV;
- use RuntimeException;
- class SuperV
- {
- /**
- * Open source and will stay so
- *
- * @var bool
- */
- public static const OPEN_SOURCE = true;
- /**
- * Free and will stay so
- *
- * @var bool
- */
- public static const IS_FREE = true;
- /**
- * Started this so long ago
- *
- * @var bool
- */
- public static const CREATED_AT = '2017-02-16';
- /**
- * So many times, so many..
- *
- * @var bool
- */
- public static const TOTAL_REWRITES = '?';
- /**
- * Current Version
- *
- * @var \Laravel\Platforms\SuperV\Version
- */
- protected $version = '0.6.dev';
- /**
- * Depends on Laravel Framework, obviously..
- *
- * @var \Laravel\Platforms\SuperV\Laravel
- */
- protected $laravel;
- /**
- * Depends on JWT-Auth package for API authentication
- *
- * @var \Laravel\Platforms\SuperV\JWTAuth
- */
- protected $jwtAuth;
- /**
- * Absolutely needs support
- *
- * @var \Laravel\Community\Support
- */
- private $support;
- /**
- * SuperV dependencies.
- *
- * @param \Laravel $laravel
- * @param \JWTAuth $jwtAuth
- * @param \CommunitySupport $support
- */
- public function __construct(Laravel $laravel, JWTAuth $jwtAuth, CommunitySupport $support)
- {
- $this->laravel = $laravel;
- $this->jwtAuth = $jwtAuth;
- $this->support = $support;
- }
- /**
- * Basic info about SuperV
- *
- * @return string
- */
- public function getInfo()
- {
- return 'SuperV is a platform built on Laravel to make your life easier';
- }
- /**
- * Get unique platform features
- *
- * @return \Laravel\Platforms\SuperV\FeatureCollection
- */
- public function getUniqueFeatures()
- {
- return (new FeatureCollection([
- ModularityFeature::make()
- ->improves('Modularity')
- ->improves('Reusability')
- ->provides('Out of the box testing-ready modules.')
- ->boot(),
- FrameworkAgnosticismFeature::make()
- ->provides('Encapsulated framework features such as routing, validation, migrations, events etc')
- ->boot(),
- ExtendedMigrationsFeature::make()
- ->provides('Single point for resource management for basic usage')
- ->provides('CRUD functionality only with migration including relations') // TODO: I should really check this
- ->creates('Pivot tables and fields if relation is defined in migrations')
- ->provides('Ability to define validation rules in migration')
- ->boot(),
- DbResourceManagementFeature::make()
- ->provides('Pop resource home page to control panel sidebar just with running migrations')
- ->provides('No creation of eloquent model files needed. If you need a model file just tell in the migration file')
- ->provides('No creation of resource files needed. If you need more features you can extend a resource in a dedicated file')
- ->provides('Tabbed relations in resource view with single line of definition in migration')
- ->provides('File uploads out of the box if defined as a field in migration')
- ->boot(),
- SpaFeature::make()
- ->provides('Fully customizable SPA VueJS based frontend framework-ish')
- ->provides('Tabbed page container which you can navigate between pages w/o closing them') // I don't believe this exists!
- ->provides('Ability to control page design with pre-coded components without writing single line of JS code')
- ->boot(),
- AuthFeature::make()
- ->provides('Easy authorization with roles, actions allowing to control the finest areas')
- ->provides('Port concept to easier segregation of API routes and Model Composers based on defined urls or url prefixes')
- ->boot(),
- ]))->unique();
- }
- /**
- * Determine if SuperV can be used by current developer
- *
- * @return bool
- */
- public function canItBeUsed()
- {
- if (starts_with($this->version, '0.') && $this->environment->isProduction()) {
- return false;
- }
- // Let's return early here..
- if ($this->developer->canReadFeaturesFromTests()
- || $this->developers->doesNotRequireDocumentation()) {
- return true;
- }
- if ($this->developer->requiresPolishedCode()) {
- return false;
- }
- if ($this->developer->requiresPerfectVariableNaming()) {
- exit;
- }
- if ($this->developer->requiresThreeLineCommentsEachShorterThanPreviousByThreeLetters()) {
- return false;
- }
- if ($this->developer->requiresPixelPerfectFrontendDesign()) {
- exit;
- }
- if ($this->developer->requires100PercentCodeCoverage()) {
- return false;
- }
- return true;
- }
- /**
- * Get differences with Nova
- *
- * @throws DiffNaziDetectedException
- */
- public function compareWithNova()
- {
- throw new DiffNaziDetectedException('Please use a diff tool instead');
- }
- /**
- * Get differences with Backpack
- *
- * @throws DiffNaziDetectedException
- */
- public function compareWithBackpack()
- {
- throw new DiffNaziDetectedException('Please use a diff tool instead');
- }
- }
Add Comment
Please, Sign In to add comment