Evercode1\ViewMaker\CrudTokens::formatTokens PHP Метод

formatTokens() публичный Метод

public formatTokens ( )
    public function formatTokens()
    {
        // need upcase model name
        $upperCaseModelName = $this->formatModelName($this->model);
        // need snakecase model name, lowercase
        $field_name = snake_case($this->model) . '_name';
        // need model path, and also account for compound words
        $modelPath = $this->formatModelPath($this->model);
        $modelInstance = $this->formatInstanceName($this->model);
        $tableName = $this->formatTableName($this->model);
        // need to account for compound model names
        $migrationModel = $this->formatMigrationModel($this->model);
        $modelId = $this->formatInstanceName($this->model) . '->id';
        $modelAttribute = $this->formatInstanceName($this->model) . '->' . $field_name;
        $useModel = 'use App\\' . $upperCaseModelName;
        $useParent = 'use App\\' . $this->formatModelName($this->parent);
        $apiRoute = 'api/' . $modelPath;
        $vueApiRoute = 'api/' . $modelPath . '-vue';
        $chartApiRoute = 'api/' . $modelPath . '-chart';
        $chartApiControllerMethod = $this->formatChartApiControllerMethod($this->model);
        $apiControllerMethod = $this->formatApiControllerMethod($this->model);
        $vueApiControllerMethod = $this->formatVueApiControllerMethod($this->model);
        $modelResults = $this->formatModelResults($this->model);
        $controllerName = $this->formatModelName($this->model) . 'Controller';
        $parent = $this->parent;
        $parentFieldName = snake_case($this->parent) . '_name';
        $parentId = $this->formatInstanceName($this->parent) . '->id';
        $parent_id = snake_case($this->parent) . '_id';
        $parentValidationList = $this->formatInstanceName($this->parent) . 'ValidationList';
        $parentInstance = $this->formatInstanceName($this->parent);
        $parentInstances = strtolower(str_plural($parentInstance));
        $parentsTableName = $this->formatParentsTableName($this->parent);
        $childsTableName = $this->formatTableName($this->child);
        $childMigrationModel = $this->formatMigrationModel($this->child);
        $child = $this->child;
        $childRelation = $this->formatChildRelation($this->child);
        $model = $this->model;
        $slug = $this->slug;
        //create token array using compact
        $tokens = compact('upperCaseModelName', 'field_name', 'modelPath', 'modelInstance', 'tableName', 'migrationModel', 'modelId', 'modelAttribute', 'useModel', 'useParent', 'apiRoute', 'vueApiRoute', 'chartApiRoute', 'chartApiControllerMethod', 'apiControllerMethod', 'vueApiControllerMethod', 'modelResults', 'controllerName', 'parent', 'parentFieldName', 'parentId', 'parent_id', 'parentValidationList', 'parentInstance', 'parentInstances', 'parentsTableName', 'childsTableName', 'childMigrationModel', 'child', 'childRelation', 'model', 'slug');
        return $tokens;
    }