move publish logic to publish namespace
This commit is contained in:
parent
415016a4c2
commit
ec127b9457
8 changed files with 69 additions and 156 deletions
|
@ -366,7 +366,9 @@ class IndexController extends Controller
|
|||
$title = new Title();
|
||||
$title->value = $formTitle['value'];
|
||||
$title->language = $formTitle['language'];
|
||||
$dataset->addMainTitle($title);
|
||||
$title->type = 'main';
|
||||
//$dataset->addMainTitle($title);
|
||||
$dataset->titles()->save($title);
|
||||
}
|
||||
|
||||
//save additional titles
|
||||
|
@ -383,7 +385,9 @@ class IndexController extends Controller
|
|||
$abstract = new Description();
|
||||
$abstract->value = $formAbstract['value'];
|
||||
$abstract->language = $formAbstract['language'];
|
||||
$dataset->addMainAbstract($abstract);
|
||||
$abstract->type = 'abstract';
|
||||
//$dataset->addMainAbstract($abstract);
|
||||
$dataset->abstracts()->save($abstract);
|
||||
}
|
||||
|
||||
//save additional descriptions
|
||||
|
@ -431,8 +435,8 @@ class IndexController extends Controller
|
|||
$user = Auth::user();
|
||||
$dataset->user()->associate($user)->save();
|
||||
|
||||
$error = 'Always throw this error';
|
||||
throw new \Exception($error);
|
||||
// $error = 'Always throw this error';
|
||||
// throw new \Exception($error);
|
||||
|
||||
// all good//commit everything
|
||||
DB::commit();
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
namespace App\Http\Controllers\Settings;
|
||||
namespace App\Http\Controllers\Publish;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
// use App\Http\Requests\ProjectRequest;
|
|
@ -1,70 +0,0 @@
|
|||
<?php
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Shelf;
|
||||
use App\Http\Requests\ShelfRequest;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ShelfController extends Controller
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$shelves = Shelf::get();
|
||||
return view('lms.settings.shelf.shelf', compact('shelves'));
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
return view('lms.settings.shelf.add');
|
||||
}
|
||||
|
||||
public function store(ShelfRequest $request)
|
||||
{
|
||||
$input = $request->all();
|
||||
|
||||
$shelf = Shelf::create($input);
|
||||
|
||||
//flash messaging
|
||||
session()->flash('flash_message', 'You have been added 1 shelf!');
|
||||
|
||||
return redirect()->route('settings.shelf');
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$shelf = Shelf::findOrFail($id);
|
||||
return view('lms.settings.shelf.edit', compact('shelf'));
|
||||
}
|
||||
|
||||
public function update($id, ShelfRequest $request)
|
||||
{
|
||||
$shelf = Shelf::findOrFail($id);
|
||||
|
||||
$input = $request->all();
|
||||
|
||||
$shelf->update($input);
|
||||
|
||||
session()->flash('flash_message', 'You have been updated 1 shelf!');
|
||||
|
||||
return redirect()->route('settings.shelf');
|
||||
}
|
||||
|
||||
public function delete($id)
|
||||
{
|
||||
$shelf = Shelf::findOrFail($id);
|
||||
|
||||
$shelf->delete();
|
||||
|
||||
session()->flash('flash_message', 'You have been deleted 1 shelf!');
|
||||
|
||||
return redirect()->route('settings.shelf');
|
||||
}
|
||||
}
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue