app/Console/Commands/FixMorphTypes.php
/**
     * Execute the console command.
     *
     * @return int
     */
Execute the console command.
@return int
Execute the console command . @return int
public function handle()
    {
        DB::table('imageables')
            ->where('imageable_type', DB::raw('"App\\\Content"'))
            ->update([
                'imageable_type' => DB::raw('"App\\\Models\\\Content"')
            ]);
        DB::table('imageables')
            ->where('imageable_type', DB::raw('"App\\\User"'))
            ->update([
                'imageable_type' => DB::raw('"App\\\Models\\\User"')
            ]);
        DB::table('follows')
            ->where('followable_type', DB::raw('"App\\\Content"'))
            ->update([
                'followable_type' => DB::raw('"App\\\Models\\\Content"')
            ]);
        DB::table('flags')
            ->where('flaggable_type', DB::raw('"App\\\Content"'))
            ->update([
                'flaggable_type' => DB::raw('"App\\\Models\\\Content"')
            ]);
        DB::table('flags')
            ->where('flaggable_type', DB::raw('"App\\\Comment"'))
            ->update([
                'flaggable_type' => DB::raw('"App\\\Models\\\Comment"')
            ]);
        DB::table('flags')
            ->where('flaggable_type', DB::raw('"App\\\Destination"'))
            ->update([
                'flaggable_type' => DB::raw('"App\\\Models\\\Destination"')
            ]);
        return 0;
    }
public function handle ( ) { DB :: table ( 'imageables' ) -> where ( 'imageable_type' , DB :: raw ( '"App\\\Content"' ) ) -> update ( [ 'imageable_type' => DB :: raw ( '"App\\\Models\\\Content"' ) ] ) ; DB :: table ( 'imageables' ) -> where ( 'imageable_type' , DB :: raw ( '"App\\\User"' ) ) -> update ( [ 'imageable_type' => DB :: raw ( '"App\\\Models\\\User"' ) ] ) ; DB :: table ( 'follows' ) -> where ( 'followable_type' , DB :: raw ( '"App\\\Content"' ) ) -> update ( [ 'followable_type' => DB :: raw ( '"App\\\Models\\\Content"' ) ] ) ; DB :: table ( 'flags' ) -> where ( 'flaggable_type' , DB :: raw ( '"App\\\Content"' ) ) -> update ( [ 'flaggable_type' => DB :: raw ( '"App\\\Models\\\Content"' ) ] ) ; DB :: table ( 'flags' ) -> where ( 'flaggable_type' , DB :: raw ( '"App\\\Comment"' ) ) -> update ( [ 'flaggable_type' => DB :: raw ( '"App\\\Models\\\Comment"' ) ] ) ; DB :: table ( 'flags' ) -> where ( 'flaggable_type' , DB :: raw ( '"App\\\Destination"' ) ) -> update ( [ 'flaggable_type' => DB :: raw ( '"App\\\Models\\\Destination"' ) ] ) ; return 0 ; }
Execute the console command.
Execute the console command .