1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

Added created_by and updated_by to entities. Fixes #3

This commit is contained in:
Dan Brown
2015-08-08 21:28:50 +01:00
parent fc50a1400d
commit 52033f3a6f
13 changed files with 132 additions and 3 deletions

View File

@ -4,6 +4,7 @@ namespace Oxbow\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Str;
use Oxbow\Http\Requests;
use Oxbow\Repos\BookRepo;
@ -82,6 +83,8 @@ class PageController extends Controller
$page->book_id = $book->id;
$page->text = strip_tags($page->html);
$page->created_by = Auth::user()->id;
$page->updated_by = Auth::user()->id;
$page->save();
return redirect($page->getUrl());
}
@ -130,6 +133,7 @@ class PageController extends Controller
$page->fill($request->all());
$page->slug = $this->pageRepo->findSuitableSlug($page->name, $book->id, $page->id);
$page->text = strip_tags($page->html);
$page->updated_by = Auth::user()->id;
$page->save();
return redirect($page->getUrl());
}