for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Install GitHub App
<?php
namespace Backpack\CRUD\app\Library\Components\Attributes\Fields;
use Backpack\CRUD\app\Library\Components\AttributeCollection;
use Backpack\CRUD\app\Library\Components\Attributes\BackpackAttribute;
use Backpack\CRUD\app\Library\Components\Interfaces\AttributeInterface;
class FieldType extends BackpackAttribute implements AttributeInterface
{
public static function getDefault(AttributeCollection $attributes)
if (backpack_pro() && $attributes->getAttributeValue('relation_type')) {
return 'relationship';
}
switch ($attributes->getAttributeValue('relation_type')) {
case 'BelongsTo':
return 'select';
case 'BelongsToMany':
case 'MorphToMany':
return 'select_multiple';
default:
return 'text';
public static function getValidationRules(): array
return ['required'];
public static function getAttributeName(): string
return 'type';