Commit abeac097 authored by Nicolas Widart's avatar Nicolas Widart

First commit

parents
<?php namespace Modules\User\Composers;
class SidebarViewComposer
{
public function compose($view)
{
$view->items->put('user', [
'weight' => 1,
'request' => $view->prefix,
'route' => 'dashboard.user.index',
'icon-class' => 'fa fa-dashboard',
'title' => 'Users',
]);
}
}
\ No newline at end of file
<?php
return [
];
\ No newline at end of file
<?php namespace Modules\Users\Database\Seeders;
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;
class UsersDatabaseSeeder extends Seeder {
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();
// $this->call("OthersTableSeeder");
}
}
\ No newline at end of file
<?php namespace Modules\User\Http\Controllers\Admin;
use Illuminate\Support\Facades\View;
use Modules\Core\Http\Controllers\Admin\AdminBaseController;
class UserController extends AdminBaseController
{
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
return View::make('user::admin.index');
}
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function create()
{
return \View::make('collection.create');
}
/**
* Store a newly created resource in storage.
*
* @return Response
*/
public function store()
{
//
}
/**
* Display the specified resource.
*
* @param int $id
* @return Response
*/
public function show($id)
{
return \View::make('collection.show');
}
/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return Response
*/
public function edit($id)
{
return \View::make('collection.edit');
}
/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function update($id)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function destroy($id)
{
//
}
}
\ No newline at end of file
<?php
Route::group(['prefix' => Config::get('core::core.admin-prefix'), 'namespace' => 'Modules\User\Http\Controllers'], function()
{
Route::resource('users', 'Admin\UserController', ['except' => ['show'], 'names' => [
'index' => 'dashboard.user.index',
'create' => 'dashboard.user.create',
'store' => 'dashboard.user.store',
'edit' => 'dashboard.user.edit',
'update' => 'dashboard.user.update',
'destroy' => 'dashboard.user.destroy',
]]);
});
\ No newline at end of file
<?php namespace Modules\Users\Providers;
use Illuminate\Support\ServiceProvider;
class UsersServiceProvider extends ServiceProvider {
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
/**
* Register the service provider.
*
* @return void
*/
public function register()
{
//
}
/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides()
{
return array();
}
}
<?php
return [
];
\ No newline at end of file
@extends('core::layouts.master')
@section('content-header')
<h1>
Users
</h1>
<ol class="breadcrumb">
<li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li>
<li class="active"><a href="#"><i class="fa fa-dashboard"></i> Users</a></li>
</ol>
@stop
@section('content')
<div class="row">
<div class="col-xs-12">
<div class="row">
@include('flash::message')
<div class="btn-group pull-right" style="margin: 0 15px 15px 0;">
<a href="{{ URL::route('dashboard.user.create') }}" class="btn btn-primary btn-flat" style="padding: 4px 10px;">
<i class="fa fa-pencil"></i> New User
</a>
</div>
</div>
<div class="box">
<div class="box-header">
</div>
<!-- /.box-header -->
<div class="box-body table-responsive">
<table class="data-table table table-bordered table-hover">
<thead>
<tr>
<th>Created at</th>
<th>Name</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php if ($users->count() > 0): ?>
<?php foreach($users as $user): ?>
<tr>
<td>
<a href="{{ URL::route('dashboard.user.edit', $user->id) }}">
{{ $user->created_at }}
</a>
</td>
<td>
<a href="{{ URL::route('dashboard.user.edit', $user->id) }}">
{{ $user->first_name }}
</a>
</td>
<td>
<div class="btn-group">
<a href="{{ URL::route('dashboard.user.edit', $user->id) }}" class="btn btn-default btn-flat"><i class="glyphicon glyphicon-pencil"></i></a>
<button class="btn btn-danger btn-flat" data-toggle="modal" data-target="#confirmation-{{ $user->id }}"><i class="glyphicon glyphicon-trash"></i></button>
</div>
</td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
<tfoot>
<tr>
<th>Created at</th>
<th>Name</th>
<th>Actions</th>
</tr>
</tfoot>
</table>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<!-- /.col (MAIN) -->
</div>
</div>
@stop
<?php
View::composer('core::partials.sidebar-nav', 'Modules\User\Composers\SidebarViewComposer');
\ No newline at end of file
{
"name": "User",
"alias": "user",
"description": "",
"keywords": [
],
"active": 1
}
\ No newline at end of file
<?php
/*
|--------------------------------------------------------------------------
| Register The Module Namespaces
|--------------------------------------------------------------------------
|
| Here is you can register the namespace for this module.
| You may to edit this namespace if you want.
|
*/
View::addNamespace('user', __DIR__ . '/Resources/views/');
Lang::addNamespace('user', __DIR__ . '/Resources/lang/');
Config::addNamespace('user', __DIR__ . '/Config/');
/*
|--------------------------------------------------------------------------
| Require The Routes file.
|--------------------------------------------------------------------------
|
| Next, this module will load filters and routes file.
|
*/
require __DIR__ . '/Http/routes.php';
require __DIR__ . '/composers.php';
\ No newline at end of file
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