Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesPong committed May 29, 2017
2 parents 6d329a5 + f4c62e6 commit 7bad326
Show file tree
Hide file tree
Showing 115 changed files with 5,250 additions and 308 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,14 @@ Homestead.json
Homestead.yaml
npm-debug.log
.env
.phpstorm.meta.php
_ide_helper.php
/storage/debugbar

/public/css
/public/js
/public/fonts
/public/img
/public/plugins
/public/mix-manifest.json
/public/images
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
### Added
- Post publish and draft status
- Soft delete support of models

### Changed
- Dashboard panel text

### Fixed
- Post editor full screen bug

## 0.1.0 - 2017-05-29
### Added
- Integrated dashboard with AdminLTE and used [webpack.mix.js](webpack.mix.js)
- Repository mode
- Base CRUD of Permission, Role, User, Category, Tag, Post
- Migrations and Seeder of Permission, Role, User, Category, Tag, Post
28 changes: 28 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Todo list of project

## Backend

- [x] Category
- [x] Tag
- [ ] Comment
- [ ] Visitor & view count(use Middleware)
- [ ] Cache
- [ ] Email
- [ ] Notification
- [ ] Socialite
- [ ] Wechat related
- [ ] Schedule(backup,stat,)
- [ ] I18N

## Frontend

- [ ] Materialize css
- [ ] Search
- [ ] Websocket

## Future

- [ ] Refactor views with VueJs
- [ ] API
- [ ] Package
- [ ] Unit test
3 changes: 3 additions & 0 deletions app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Auth\Traits\AuthRedirect;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;

class LoginController extends Controller
{
use AuthRedirect;

/*
|--------------------------------------------------------------------------
| Login Controller
Expand Down
3 changes: 3 additions & 0 deletions app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Auth\Traits\AuthRedirect;
use App\Models\User;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Validator;
use Illuminate\Foundation\Auth\RegistersUsers;

class RegisterController extends Controller
{
use AuthRedirect;

/*
|--------------------------------------------------------------------------
| Register Controller
Expand Down
3 changes: 3 additions & 0 deletions app/Http/Controllers/Auth/ResetPasswordController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Auth\Traits\AuthRedirect;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ResetsPasswords;

class ResetPasswordController extends Controller
{
use AuthRedirect;

/*
|--------------------------------------------------------------------------
| Password Reset Controller
Expand Down
16 changes: 16 additions & 0 deletions app/Http/Controllers/Auth/Traits/AuthRedirect.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace App\Http\Controllers\Auth\Traits;

trait AuthRedirect
{
/**
* Where to redirect users after login (Priority)
*
* @return string
*/
protected function redirectTo()
{
return route('dashboard.index');
}
}
110 changes: 110 additions & 0 deletions app/Http/Controllers/Backend/CategoryController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<?php

namespace App\Http\Controllers\Backend;

use App\Http\Controllers\Controller;
use App\Http\Requests\StoreUpdateCategoryRequest;
use App\Repositories\Contracts\CategoryRepository;
use Illuminate\Http\Request;

class CategoryController extends Controller
{
protected $cateRepo;

/**
* CategoryController constructor.
* @param CategoryRepository $cateRepo
*/
public function __construct(CategoryRepository $cateRepo)
{
$this->cateRepo = $cateRepo;
}

/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$categories = $this->cateRepo->paginate();

return view('admin.categories.index', compact('categories'));
}

/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
return view('admin.categories.create');
}

/**
* Store a newly created resource in storage.
*
* @param StoreUpdateCategoryRequest $request
* @return \Illuminate\Http\Response
*/
public function store(StoreUpdateCategoryRequest $request)
{
$category = $this->cateRepo->createCategory($request->all());

return redirect()->route('categories.index');
}

/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
$category = $this->cateRepo->find($id);

return response($category);
}

/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$category = $this->cateRepo->find($id);

return view('admin.categories.edit', compact('category'));
}

/**
* Update the specified resource in storage.
*
* @param StoreUpdateCategoryRequest $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(StoreUpdateCategoryRequest $request, $id)
{
$category = $this->cateRepo->updateCategory($request->all(), $id);

return redirect()->route('categories.index');
}

/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
$this->cateRepo->delete($id);

return redirect()->route('categories.index');
}
}
14 changes: 14 additions & 0 deletions app/Http/Controllers/Backend/DashboardController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php

namespace App\Http\Controllers\Backend;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class DashboardController extends Controller
{
public function index()
{
return view('admin.home');
}
}
110 changes: 110 additions & 0 deletions app/Http/Controllers/Backend/PermissionController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
<?php

namespace App\Http\Controllers\Backend;

use App\Http\Requests\StoreUpdatePermissionRequest;
use App\Repositories\Contracts\PermissionRepository;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class PermissionController extends Controller
{
protected $permRepo;

/**
* PermissionController constructor.
* @param \App\Repositories\Contracts\PermissionRepository $permRepo
*/
public function __construct(PermissionRepository $permRepo)
{
$this->permRepo = $permRepo;
}

/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$permissions = $this->permRepo->paginate();

return view('admin.permissions.index', compact('permissions'));
}

/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
return view('admin.permissions.create');
}

/**
* Store a newly created resource in storage.
*
* @param StoreUpdatePermissionRequest $request
* @return \Illuminate\Http\Response
*/
public function store(StoreUpdatePermissionRequest $request)
{
$perm = $this->permRepo->create($request->all());

return redirect()->route('permissions.index');
}

/**
* Display the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function show($id)
{
$perm = $this->permRepo->find($id);

return response($perm);
}

/**
* Show the form for editing the specified resource.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function edit($id)
{
$permission = $this->permRepo->find($id);

return view('admin.permissions.edit', compact('permission'));
}

/**
* Update the specified resource in storage.
*
* @param StoreUpdatePermissionRequest $request
* @param int $id
* @return \Illuminate\Http\Response
*/
public function update(StoreUpdatePermissionRequest $request, $id)
{
$perm = $this->permRepo->update($request->all(), $id);

return redirect()->route('permissions.index');
}

/**
* Remove the specified resource from storage.
*
* @param int $id
* @return \Illuminate\Http\Response
*/
public function destroy($id)
{
$this->permRepo->delete($id);

return redirect()->route('permissions.index');
}
}
Loading

0 comments on commit 7bad326

Please sign in to comment.