Tidy up admin cp article related views
This commit is contained in:
parent
abeb5c68f7
commit
7c11b08feb
10 changed files with 14 additions and 14 deletions
|
@ -6,7 +6,7 @@ use App\Article;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
|
|
||||||
class ArticlesConrtoller extends Controller
|
class ArticlesController extends Controller
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* List the articles that can be edited.
|
* List the articles that can be edited.
|
||||||
|
@ -17,7 +17,7 @@ class ArticlesConrtoller extends Controller
|
||||||
{
|
{
|
||||||
$posts = Article::select('id', 'title', 'published')->orderBy('id', 'desc')->get();
|
$posts = Article::select('id', 'title', 'published')->orderBy('id', 'desc')->get();
|
||||||
|
|
||||||
return view('admin.listarticles', ['posts' => $posts]);
|
return view('admin.articles.list', ['posts' => $posts]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -29,7 +29,7 @@ class ArticlesConrtoller extends Controller
|
||||||
{
|
{
|
||||||
$message = session('message');
|
$message = session('message');
|
||||||
|
|
||||||
return view('admin.newarticle', ['message' => $message]);
|
return view('admin.articles.new', ['message' => $message]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -71,7 +71,7 @@ class ArticlesConrtoller extends Controller
|
||||||
throw $e;
|
throw $e;
|
||||||
}
|
}
|
||||||
|
|
||||||
return view('admin.newarticlesuccess', ['id' => $article->id, 'title' => $article->title]);
|
return view('admin.articles.newsuccess', ['id' => $article->id, 'title' => $article->title]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -89,7 +89,7 @@ class ArticlesConrtoller extends Controller
|
||||||
'published'
|
'published'
|
||||||
)->where('id', $articleId)->get();
|
)->where('id', $articleId)->get();
|
||||||
|
|
||||||
return view('admin.editarticle', ['id' => $articleId, 'post' => $post]);
|
return view('admin.articles.edit', ['id' => $articleId, 'post' => $post]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -112,7 +112,7 @@ class ArticlesConrtoller extends Controller
|
||||||
$article->published = $published;
|
$article->published = $published;
|
||||||
$article->save();
|
$article->save();
|
||||||
|
|
||||||
return view('admin.editarticlesuccess', ['id' => $articleId]);
|
return view('admin.articles.editsuccess', ['id' => $articleId]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -123,7 +123,7 @@ class ArticlesConrtoller extends Controller
|
||||||
*/
|
*/
|
||||||
public function delete($articleId)
|
public function delete($articleId)
|
||||||
{
|
{
|
||||||
return view('admin.deletearticle', ['id' => $articleId]);
|
return view('admin.articles.delete', ['id' => $articleId]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -136,6 +136,6 @@ class ArticlesConrtoller extends Controller
|
||||||
{
|
{
|
||||||
Article::where('id', $articleId)->delete();
|
Article::where('id', $articleId)->delete();
|
||||||
|
|
||||||
return view('admin.deletearticlesuccess', ['id' => $articleId]);
|
return view('admin.articles.deletesuccess', ['id' => $articleId]);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -8,13 +8,13 @@ Admin CP
|
||||||
<h1>Hello {{ $name }}!</h1>
|
<h1>Hello {{ $name }}!</h1>
|
||||||
|
|
||||||
<h2>Articles</h2>
|
<h2>Articles</h2>
|
||||||
<p>You can either <a href="/admin/blog/new">create</a> new blog posts, or <a href="/admin/blog/edit">edit</a> them.<p>
|
<p>You can either <a href="/admin/articles/new">create</a> new blog posts, or <a href="/admin/articles/edit">edit</a> them.<p>
|
||||||
|
|
||||||
<h2>Notes</h2>
|
<h2>Notes</h2>
|
||||||
<p>You can either <a href="/admin/note/new">create</a> new notes, or <a href="/admin/note/edit">edit</a> them.<p>
|
<p>You can either <a href="/admin/notes/new">create</a> new notes, or <a href="/admin/notes/edit">edit</a> them.<p>
|
||||||
|
|
||||||
<h2>Tokens</h2>
|
<h2>Clients</h2>
|
||||||
<p>See all <a href="/admin/tokens">issued tokens</a>.</p>
|
<p>You can either <a href="/admin/clients/new">create</a> new contacts, or <a href="/admin/contacts/edit">edit</a> them.</p>
|
||||||
|
|
||||||
<h2>Contacts</h2>
|
<h2>Contacts</h2>
|
||||||
<p>You can either <a href="/admin/contacts/new">create</a> new contacts, or <a href="/admin/contacts/edit">edit</a> them.</p>
|
<p>You can either <a href="/admin/contacts/new">create</a> new contacts, or <a href="/admin/contacts/edit">edit</a> them.</p>
|
||||||
|
|
|
@ -41,7 +41,7 @@ Route::group(['domain' => config('url.longurl')], function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
//Articles
|
//Articles
|
||||||
Route::group(['prefix' => 'blog'], function () {
|
Route::group(['prefix' => 'articles'], function () {
|
||||||
Route::get('/new', 'ArticlesController@create');
|
Route::get('/new', 'ArticlesController@create');
|
||||||
Route::get('/edit', 'ArticlesController@index');
|
Route::get('/edit', 'ArticlesController@index');
|
||||||
Route::get('/edit/{id}', 'ArticlesController@edit');
|
Route::get('/edit/{id}', 'ArticlesController@edit');
|
||||||
|
@ -52,7 +52,7 @@ Route::group(['domain' => config('url.longurl')], function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
//Notes
|
//Notes
|
||||||
Route::group(['prefix' => 'note'], function () {
|
Route::group(['prefix' => 'notes'], function () {
|
||||||
Route::get('/edit', 'NotesController@index');
|
Route::get('/edit', 'NotesController@index');
|
||||||
Route::get('/new', 'NotesController@create');
|
Route::get('/new', 'NotesController@create');
|
||||||
Route::get('/edit/{id}', 'NotesController@edit');
|
Route::get('/edit/{id}', 'NotesController@edit');
|
||||||
|
|
Loading…
Add table
Reference in a new issue