mirror of
https://gitlab.com/TheGamecraft/c-cms.git
synced 2026-04-21 02:39:10 -04:00
feat added custom pages
This commit is contained in:
@@ -54,6 +54,10 @@ use Illuminate\Database\Eloquent\Model;
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Event whereUserId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Event whereWeeklyMsgFile($value)
|
||||
* @mixin \Eloquent
|
||||
* @property string $weekly_msg_publication_time
|
||||
* @property int $hidden
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Event whereHidden($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Event whereWeeklyMsgPublicationTime($value)
|
||||
*/
|
||||
class Event extends Model
|
||||
{
|
||||
|
||||
@@ -43,6 +43,8 @@ use Illuminate\Database\Eloquent\Model;
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\EventType whereUseWeeklyMsg($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\EventType whereWeeklyMsgPublicationTime($value)
|
||||
* @mixin \Eloquent
|
||||
* @property int $hidden
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\EventType whereHidden($value)
|
||||
*/
|
||||
class EventType extends Model
|
||||
{
|
||||
|
||||
111
app/Http/Controllers/PublicPageController.php
Normal file
111
app/Http/Controllers/PublicPageController.php
Normal file
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\PublicPage;
|
||||
use Illuminate\Http\Request;
|
||||
use PHPUnit\Util\Json;
|
||||
|
||||
class PublicPageController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('admin.public_page.index', ['pages' => PublicPage::all()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\PublicPage $publicPage
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function show(PublicPage $publicPage)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\PublicPage $publicPage
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(string $publicPage)
|
||||
{
|
||||
return view('admin.public_page.edit', ['page' => PublicPage::find($publicPage)]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\PublicPage $publicPage
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, string $publicPage)
|
||||
{
|
||||
$page = PublicPage::find($publicPage);
|
||||
|
||||
$page->body = $request->body;
|
||||
$page->header = $request->header;
|
||||
$page->banner = $request->banner;
|
||||
|
||||
$page->save();
|
||||
|
||||
return redirect('/admin/public-pages');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\PublicPage $publicPage
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy(PublicPage $publicPage)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the specified resource.
|
||||
*
|
||||
* @param \App\PublicPage $publicPage
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function display(string $publicPage)
|
||||
{
|
||||
$page = PublicPage::whereName($publicPage)->first();
|
||||
|
||||
if($page == null) {
|
||||
abort(404);
|
||||
}
|
||||
|
||||
return view('public.publicpage', ['page' => $page]);
|
||||
}
|
||||
}
|
||||
32
app/PublicPage.php
Normal file
32
app/PublicPage.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* App\PublicPage
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $name
|
||||
* @property string $banner
|
||||
* @property string $header
|
||||
* @property string $body
|
||||
* @property \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\PublicPage newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\PublicPage newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\PublicPage query()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\PublicPage whereBanner($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\PublicPage whereBody($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\PublicPage whereCreatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\PublicPage whereHeader($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\PublicPage whereId($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\PublicPage whereName($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\PublicPage whereUpdatedAt($value)
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class PublicPage extends Model
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -62,6 +62,8 @@ use phpDocumentor\Reflection\Types\Collection;
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\User whereTelephone($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\User whereUpdatedAt($value)
|
||||
* @mixin \Eloquent
|
||||
* @property int $use_default_psw
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\User whereUseDefaultPsw($value)
|
||||
*/
|
||||
class User extends Authenticatable
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user