Skip to content

Commit

Permalink
fix cms_moduls soft delete error
Browse files Browse the repository at this point in the history
  • Loading branch information
924211739 committed Jun 6, 2017
1 parent 47c025d commit c3981b1
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/controllers/ModulsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ public function postStep2() {

if(!Request::get('id')) {

if(DB::table('cms_moduls')->where('path',$path)->count()) {
if(DB::table('cms_moduls')->where('path',$path)->where('deleted_at',NULL)->count()) {
return redirect()->back()->with(['message'=>'Sorry the slug has already exists, please choose another !','message_type'=>'warning']);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddDeletedAtCmsModuls extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('cms_moduls', function(Blueprint $table)
{
$table->softDeletes();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('cms_moduls', function(Blueprint $table)
{
$table->dropSoftDeletes();
});
}
}

0 comments on commit c3981b1

Please sign in to comment.