PHP Method Schema::getColumnType, someline-starter Code Examples

This page contains top rated real world PHP examples of method Schema::getColumnType from package someline-starter extracted from open source projects. You can rate examples to help us improve the quality of examples
Frequently Used Methods

getColumnType() public static method

Get the data type for the given column name.
public static getColumnType ( string $table, string $column ) : string
$table string
$column string
return string
Example #1
Show file File: Save.php Project: ConsoleTVs/Laralum
0
| $request - The form requrest information                                  |
|																			|
+---------------------------------------------------------------------------+
|																			|
| This files saves the new information to the database                      |                       				|
|																			|
+---------------------------------------------------------------------------+
*/
include 'Get.php';
# Validate The Request
$this->validate($request, $validator);
# Update the row
foreach ($fields as $field) {
    $save = true;
    # Check the field type
    $type = Schema::getColumnType($table, $field);
    # Get the value
    $value = $request->input($field);
    if ($type == 'string' or $type == 'integer') {
        # Check if it's a default_random field
        foreach ($default_random as $random) {
            if ($random == $field) {
                if (!$value) {
                    $value = str_random(10);
                }
            }
        }
        # Check if it's a hashed field
        foreach ($hashed as $hash) {
            if ($hash == $field) {
                if ($value) {
Example #2
Show file File: generator.php Project: larakit/lk
0
<?php

\Larakit\CRUD\CrudRow::register(\Larakit\Models\Entity::class, '/admincp/entities');
define('ROUTE_ADMIN_CODEGEN', 'larakit::admin.codegen');
\Larakit\Route\Route::item(ROUTE_ADMIN_CODEGEN)->setBaseUrl('/admincp/generator')->put()->addSegment('{model}')->put();
define('ROUTE_ADMIN', 'larakit::admin');
\Larakit\Route\Route::item(ROUTE_ADMIN)->setBaseUrl('/admincp/')->put();
\Adminlte\Widget\WidgetSidebarMenu::group('ГЕНЕРАТОР КОДА')->addItem('codegen', 'Модели', ROUTE_ADMIN_CODEGEN);
return;
$ret = [];
foreach (Schema::getColumnListing('bmmaket-core__recommend_groups') as $name) {
    $ret[$name] = Schema::getColumnType('bmmaket-core__recommend_groups', $name);
}
dd($ret);
dd(DB::table('bmmaket-core__recommend_groups'));