edit static pages in backend
This commit is contained in:
parent
e771c4921f
commit
783ac823ba
59 changed files with 1644 additions and 761 deletions
46
app/Http/Controllers/Settings/PagesTableController.php
Normal file
46
app/Http/Controllers/Settings/PagesTableController.php
Normal file
|
@ -0,0 +1,46 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Settings;
|
||||
|
||||
use App\Models\Page;
|
||||
use App\Http\Controllers\Controller;
|
||||
// use App\Http\Requests\Backend\Pages\ManagePageRequest;
|
||||
use App\Http\Requests\Pages\IndexPageRequest;
|
||||
// use App\Repositories\Backend\Pages\PagesRepository;
|
||||
use Yajra\DataTables\Facades\DataTables;
|
||||
|
||||
/**
|
||||
* Class PagesTableController.
|
||||
*/
|
||||
class PagesTableController extends Controller
|
||||
{
|
||||
protected $pages;
|
||||
|
||||
|
||||
public function __construct() //(PagesRepository $pages)
|
||||
{
|
||||
//$this->pages = factory(Page::class, 2)->make();
|
||||
$this->pages = Page::get();
|
||||
}
|
||||
|
||||
|
||||
public function get()
|
||||
{
|
||||
$test = Datatables::of($this->pages)
|
||||
->escapeColumns(['title'])
|
||||
->addColumn('status', function ($page) {
|
||||
return $page->status;
|
||||
})
|
||||
->addColumn('created_at', function ($page) {
|
||||
return $page->created_at->toDateString();
|
||||
})
|
||||
->addColumn('created_by', function ($page) {
|
||||
return $page->created_by;
|
||||
})
|
||||
->addColumn('actions', function ($page) {
|
||||
return $page->action_buttons;
|
||||
})
|
||||
->make(true);
|
||||
return $test;
|
||||
}
|
||||
}
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue