Commit 1e7289e3 by Aan Choesni Herlingga

lang feature, added route webprofile, example controller

parent cd99fa99
<?php
namespace App\Http\Controllers\Webprofile\Backend;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use App\Repositories\Webprofile\CategoryRepository;
class CategoryController extends Controller
{
private $repo;
public function __construct(CategoryRepository $repo)
{
$this->repo = $repo;
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index(Request $request)
{
dd('asd');
if ($request->ajax()) {
$data = $this->categoryRepo->get(null, ['rProcess']);
return $this->categoryRepo->datatable($data);
}
return view('webprofile.backend.categories.index');
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
return view('webprofile.backend.categories.create')->withTitle(trans('feature.create_category'));
}
/**
* 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 int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(Request $request, $id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
//
}
}
......@@ -54,6 +54,10 @@ class RouteServiceProvider extends ServiceProvider
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/webprofile/backend.php'));
}
/**
......
<?php
return [
'category' => 'Category',
'categoryfile' => 'Category File',
'design' => 'Design',
'file' => 'File',
'gallery' => 'Gallery',
'information' => 'Information',
'menu' => 'Menu',
'page' => 'Page',
'post' => 'Post',
'setting' => 'Setting',
'slider' => 'Slider',
'create_category' => 'Create Category',
'create_categoryfile' => 'Create Category File',
'create_design' => 'Create Design',
'create_file' => 'Create File',
'create_gallery' => 'Create Gallery',
'create_information' => 'Create Information',
'create_menu' => 'Create Menu',
'create_page' => 'Create Page',
'create_post' => 'Create Post',
'create_setting' => 'Create Setting',
'create_slider' => 'Create Slider',
'edit_category' => 'Edit Category',
'edit_categoryfile' => 'Edit Category File',
'edit_design' => 'Edit Design',
'edit_file' => 'Edit File',
'edit_gallery' => 'Edit Gallery',
'edit_information' => 'Edit Information',
'edit_menu' => 'Edit Menu',
'edit_page' => 'Edit Page',
'edit_post' => 'Edit Post',
'edit_setting' => 'Edit Setting',
'edit_slider' => 'Edit Slider',
];
<?php
return [
'category' => 'Kategori',
'categoryfile' => 'Kategori Dokumen',
'design' => 'Desain',
'file' => 'Dokumen',
'gallery' => 'Gallery',
'information' => 'Informasi',
'menu' => 'Menu',
'page' => 'Halaman',
'post' => 'Berita',
'setting' => 'Pengaturan',
'slider' => 'Slider',
'create_category' => 'Tambah Kategori',
'create_categoryfile' => 'Tambah Kategori Dokumen',
'create_design' => 'Tambah Desain',
'create_file' => 'Tambah Dokumen',
'create_gallery' => 'Tambah Gallery',
'create_information' => 'Tambah Informasi',
'create_menu' => 'Tambah Menu',
'create_page' => 'Tambah Halaman',
'create_post' => 'Tambah Berita',
'create_setting' => 'Tambah Pengaturan',
'create_slider' => 'Tambah Slider',
'edit_category' => 'Ubah Kategori',
'edit_categoryfile' => 'Ubah Kategori Dokumen',
'edit_design' => 'Ubah Desain',
'edit_file' => 'Ubah Dokumen',
'edit_gallery' => 'Ubah Gallery',
'edit_information' => 'Ubah Informasi',
'edit_menu' => 'Ubah Menu',
'edit_page' => 'Ubah Halaman',
'edit_post' => 'Ubah Berita',
'edit_setting' => 'Ubah Pengaturan',
'edit_slider' => 'Ubah Slider',
];
<?php
Route::group(['middleware' => 'auth'], function () {
// Route::group(['middleware' => 'role:admin'], function () {
Route::group(['namespace' => 'Webprofile\Backend', 'prefix' => 'webprofile'], function () {
Route::resource('category', 'CategoryController');
});
// });
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment