Update Guide

Please note that this update is really big make sure that you have created a backup copy before update

Note: You have to update your applications your own, we are not going to provide free support for updating your applications.

Some tips

What's new

List of files changed

In this update almost every file is changed. List is too long to be provided.

How to update

Make sure to create backup of database and files, backup is very important for this update

app/artvenue
app/lang
app/library
app/database
app/controllers
app/models
app/views
app/filters.php
app/routes.php
public/static

Search for At about line no. 123

'Illuminate\Workbench\WorkbenchServiceProvider',

Add this line just below it

'Artvenue\Providers\RepositoryServiceProvider',

It will look something like this

'Illuminate\Workbench\WorkbenchServiceProvider',
'Artvenue\Providers\RepositoryServiceProvider',
Route::get('update', function ()
{
    Artisan::call('migrate', array('--force' => true));

    DB::statement('ALTER TABLE `images` MODIFY COLUMN `title`  varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL AFTER `image_name`');
    DB::statement('ALTER TABLE `images` MODIFY COLUMN `image_description`  text CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL AFTER `slug`');
    DB::statement('ALTER TABLE `images` MODIFY COLUMN `tags`  varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL AFTER `category_id`');
    DB::statement('ALTER TABLE `images` MODIFY COLUMN `downloads`  int(11) NOT NULL DEFAULT 0 AFTER `views`');
    Schema::table('images', function ($table)
    {
        $table->boolean('is_adult')->default(0)->after('allow_download');
        $table->timestamp('approved_at')->nullable()->after('is_adult');
        $table->timestamp('featured_at')->nullable()->after('approved_at');
    });
    Schema::table('users', function ($table)
    {
        $table->timestamp('featured_at')->nullable()->after('remember_token');
    });
    $images = Images::get();
    foreach ($images as $image)
    {
        if ($image->is_featured == 1)
        {
            $image->featured_at = $image->updated_at;
        }
        if ($image->approved)
        {
            $image->approved_at = $image->created_at;
        }
        $image->save();
        $info = new ImageInfo();
        $info->image_id = $image->id;
        $info->save();
    }

    $users = User::get();
    foreach ($users as $user)
    {
        if ($user->is_featured)
        {
            $user->featured_at = $user->updated_at;
        }
    }
    Schema::table('images', function ($table)
    {
        $table->dropColumn('approved');
        $table->dropColumn('is_featured');
    });
    Schema::table('users', function ($table)
    {
        $table->dropColumn('is_featured');
    });

        File::cleanDirectory(storage_path() . '/cache');
        File::cleanDirectory(storage_path() . '/views');
        File::cleanDirectory(storage_path() . '/logs');

    return Redirect::route('gallery')->with('flashSuccess', 'Site is now updated');
});

© Abhimanyu Sharma http://twitter.com/abhimanyu003