Overview

Namespaces

  • Composer
    • Autoload
  • Illuminate
    • Support
      • Contracts
      • Facades
  • Laravella
    • Crud
      • Exceptions
      • Facades
  • None
  • PHP

Classes

  • ComposerAutoloaderInit0812ead62c33200f1cfc491b452f7c6a
  • CreateActionsTable
  • CreateAssetsTable
  • CreateAuditTable
  • CreateDisplayTypesTable
  • CreateEventsTable
  • CreateFieldsTable
  • CreateKeyFieldsTable
  • CreateKeysTable
  • CreateKeyTypesTable
  • CreateLogsTable
  • CreateMenuPermissionsTable
  • CreateMenusTable
  • CreateObjectEventsTable
  • CreateObjectsTable
  • CreateOptionsTable
  • CreateOptionTypesTable
  • CreatePageAssetsTable
  • CreatePagesTable
  • CreateSeveritiesTable
  • CreateTablesTable
  • CreateUserGroupPermissionsTable
  • CreateUsergroupsTable
  • CreateUserPermissionsTable
  • CreateViewsTable
  • CreateWidgetTypesTable
  • DbApiController
  • DbController
  • Domain
  • field
  • foreignKey
  • Model
  • PageController
  • primaryKey
  • Record
  • Relation
  • Table
  • xxxxAddMcollectionMediaTable
  • xxxxCreateUsersTable

Functions

  • action
  • app
  • app_path
  • array_add
  • array_build
  • array_divide
  • array_dot
  • array_except
  • array_fetch
  • array_first
  • array_flatten
  • array_forget
  • array_get
  • array_only
  • array_pluck
  • array_pull
  • array_set
  • array_sort
  • asset
  • base_path
  • camel_case
  • class_basename
  • csrf_token
  • dd
  • e
  • ends_with
  • head
  • last
  • link_to
  • link_to_action
  • link_to_asset
  • link_to_route
  • object_get
  • public_path
  • route
  • secure_asset
  • secure_url
  • snake_case
  • starts_with
  • storage_path
  • str_contains
  • str_finish
  • str_is
  • str_plural
  • str_random
  • str_singular
  • studly_case
  • trans
  • trans_choice
  • url
  • value
  • with
  • Overview
  • Namespace
  • Class
  • Tree
 1: <?php
 2: 
 3: use Illuminate\Database\Schema\Blueprint;
 4: use Illuminate\Database\Migrations\Migration;
 5: 
 6: class CreateTablesTable extends Migration {
 7: 
 8:     /**
 9:      * Run the migrations.
10:      *
11:      * @access   public
12:      * @return   void
13:      */
14:     public function up()
15:     {
16:         if (!Schema::hasTable('_db_tables'))
17:         {
18:             Schema::create('_db_tables', function ($table)
19:                     {
20:                         $table->increments('id')->unique();
21:                         $table->string('name', 100)->unique();
22:                         $table->timestamp('created_at')->default(DB::raw('CURRENT_TIMESTAMP'));
23:                         $table->timestamp('updated_at')->default('0000-00-00 00:00:00');
24:                     });
25:         }
26:     }
27: 
28:     /**
29:      * Reverse the migrations.
30:      *
31:      * @access   public
32:      * @return   void
33:      */
34:     public function down()
35:     {
36:         Schema::dropIfExists('_db_tables');
37:     }
38: 
39:     /**
40:      * Replace _ with spaces and make first character of each word uppercase
41:      * 
42:      * @param type $name
43:      */
44:     private function __makeLabel($name)
45:     {
46:         return ucwords(str_replace('_', ' ', $name));
47:     }
48: 
49:     /**
50:      * Returns varchar if fieldType = varchar(100) etc.
51:      */
52:     private function __getFieldType($fieldType)
53:     {
54:         $start = strpos($fieldType, '(');
55:         if ($start > 0)
56:         {
57:             $fieldType = substr($fieldType, 0, $start);
58:             $this->__log("success", "fieldtype : $fieldType");
59:         }
60:         return $fieldType;
61:     }
62: 
63:     /**
64:      * Returns 100 if fieldType = varchar(100) etc.
65:      */
66:     private function __getFieldLength($fieldType)
67:     {
68:         $start = strpos($fieldType, '(') + 1;
69:         $len = null;
70:         if ($start > 0)
71:         {
72:             $count = strpos($fieldType, ')') - $start;
73:             $len = substr($fieldType, $start, $count);
74:             //$this->__log("success", "fieldtype : $fieldType, start : $start, count : $count, len : $len");
75:         }
76: 
77:         return $len;
78:     }
79: 
80:     /**
81:      * Try and calculate the width of the widget to display the field in 
82:      */
83:     private function __getFieldWidth($fieldType, $fieldLength)
84:     {
85:         return 100;
86:     }
87: 
88:     /**
89:      * Try and calculate the best widget to display the field in. Define the widget in json
90:      */
91:     private function __getFieldWidget($fieldType, $fieldLength)
92:     {
93:         return ""; //'{widget" : "input", "attributes" : {"type" : "text"}}';
94:     }
95: 
96: }
97: 
crud API documentation generated by ApiGen 2.8.0