mirror of
https://github.com/HDInnovations/UNIT3D-Community-Edition.git
synced 2026-04-30 07:20:25 -05:00
(Fix) Closes #187
- Foreign Key Migration Updated - Model Updated - Controller Updated
This commit is contained in:
+2
-2
@@ -23,8 +23,8 @@ class Category extends Model
|
||||
*
|
||||
*/
|
||||
public $rules = [
|
||||
'name' => 'required|unique:categories',
|
||||
'slug' => 'required|unique:categories',
|
||||
'name' => 'required',
|
||||
'slug' => 'required',
|
||||
'icon' => 'required',
|
||||
'meta' => 'required'
|
||||
];
|
||||
|
||||
@@ -91,6 +91,6 @@ class CategoryController extends Controller
|
||||
{
|
||||
$category = Category::findOrFail($id);
|
||||
$category->delete();
|
||||
return redirect()->route('staff_category_index')->with(Toastr::error('Category Sucessfully Deleted', 'Whoops!', ['options']));
|
||||
return redirect()->route('staff_category_index')->with(Toastr::success('Category Sucessfully Deleted', 'Yay!', ['options']));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ class AddForeignKeysToTorrentsTable extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::table('torrents', function (Blueprint $table) {
|
||||
$table->foreign('category_id', 'category_id')->references('id')->on('categories')->onUpdate('RESTRICT')->onDelete('RESTRICT');
|
||||
$table->foreign('category_id', 'category_id')->references('id')->on('categories')->onUpdate('RESTRICT')->onDelete('CASCADE');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user