1º
Navigate to: laravel/vendor/laravel/framework/src/Illuminate/Database/Schema
Open: Blueprint.php
Find:
public function increments($column)
{
return $this->unsignedInteger($column, true);
}
Add after this:
/**
* Create a new auto-incrementing tiny integer column on the table.
*
* @param string $column
* @return \Illuminate\Support\Fluent
*/
public function incrementsTinyInteger($column)
{
return $this->unsignedTinyInteger($column, true);
}
/**
* Create a new auto-incrementing small integer column on the table.
*
* @param string $column
* @return \Illuminate\Support\Fluent
*/
public function incrementsSmallInteger($column)
{
return $this->unsignedSmallInteger($column, true);
}
/**
* Create a new auto-incrementing medium integer column on the table.
*
* @param string $column
* @return \Illuminate\Support\Fluent
*/
public function incrementsMediumInteger($column)
{
return $this->unsignedMediumInteger($column, true);
}
Find:
public function unsignedInteger($column, $autoIncrement = false)
{
return $this->integer($column, $autoIncrement, true);
}
Add after this:
/**
* Create a new unsigned tiny integer column on the table.
*
* @param string $column
* @param bool $autoIncrement
* @param bool $unsigned
* @return \Illuminate\Support\Fluent
*/
public function unsignedTinyInteger($column, $autoIncrement = false)
{
return $this->tinyInteger($column, $autoIncrement, true);
}
/**
* Create a new unsigned small integer column on the table.
*
* @param string $column
* @param bool $autoIncrement
* @param bool $unsigned
* @return \Illuminate\Support\Fluent
*/
public function unsignedSmallInteger($column, $autoIncrement = false)
{
return $this->smallInteger($column, $autoIncrement, true);
}
/**
* Create a new unsigned medium integer column on the table.
*
* @param string $column
* @param bool $autoIncrement
* @param bool $unsigned
* @return \Illuminate\Support\Fluent
*/
public function unsignedMediumInteger($column, $autoIncrement = false)
{
return $this->mediumInteger($column, $autoIncrement, true);
}
2º
Navigate to: laravel/vendor/laravel/framework/src/Illuminate/Database/Schema/Grammars
Open: MySqlGrammar.php
Find: protected $serials = array('bigInteger', 'integer');
Change to: protected $serials = array('bigInteger', 'integer', 'tinyInteger', 'smallInteger', 'mediumInteger');
3º
plus, in the same file above, find:
protected function typeTinyInteger(Fluent $column)
{
return 'tinyint(1)';
}
Change to:
protected function typeTinyInteger(Fluent $column)
{
return 'tinyint';
}
If someone know how to extend this files and config the usage in laravel, and want to share the how-to i will apreciate. But I dont know how to config everthing after extend these files and this is the way i know how to do this in laravel.
Blueprintclass in a separate directory outside thevendorsfolder so that it does not get overwritten if you ever update with composer. - Glad To Help