1Schema::table('users', function (Blueprint $table) {
2 $table->renameColumn('from', 'to');
3});
1// To drop a column, use the dropColumn method on the schema builder.
2// Before dropping columns from a SQLite database, you will need to add
3// the doctrine/dbal dependency to your composer.json file and run the
4// composer update command in your terminal to install the library:
5
6Schema::table('users', function (Blueprint $table) {
7 $table->dropColumn('votes');
8});
1public function down()
2{
3 Schema::table('posts', function (Blueprint $table) {
4 $table->renameColumn('user_id', 'author_ID');
5 });
6}
7
1public function up()
2{
3 Schema::table('posts', function (Blueprint $table) {
4 $table->renameColumn('author_ID', 'user_id');
5 });
6}
7
1public function getDateStartAttribute($value)
2{
3 return Carbon::parse($value)->format('Y-m-d\TH:i');
4}
5
6public function getDateEndAttribute($value)
7{
8 return Carbon::parse($value)->format('Y-m-d\TH:i');
9}
10