Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesPong committed Jan 29, 2018
2 parents 6a445fe + f4a2ddc commit 28118bc
Show file tree
Hide file tree
Showing 240 changed files with 18,981 additions and 3,998 deletions.
8 changes: 6 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ DB_PASSWORD=secret
BROADCAST_DRIVER=log
CACHE_DRIVER=file
SESSION_DRIVER=file
SESSION_LIFETIME=120
QUEUE_DRIVER=sync

REDIS_HOST=127.0.0.1
Expand All @@ -31,13 +32,16 @@ MAIL_ENCRYPTION=null
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

YOUDAO_APP_KEY=
YOUDAO_APP_SECRET=

GOOGLE_ANALYTICS_ID=
ENABLE_DATA_CACHE=
#ENABLE_DATA_CACHE=
ENABLE_VISITOR_LOG=

COMMENT_DRIVER=
DISQUS_SHORT_NAME=
DISQUS_SHORT_NAME=

FILESYSTEM_DRIVER=
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
.env
.phpstorm.meta.php
_ide_helper.php
_ide_helper_models.php
/storage/debugbar

/public/css
Expand All @@ -19,3 +21,6 @@ _ide_helper.php
/public/img
/public/plugins
/public/mix-manifest.json

/public/frontend
/public/backend
30 changes: 29 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,34 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Fixed

## 0.4.0 - 2018-01-29
### Added
- Multiple mix support
- Materialize-css views in dashboard
- Vue support
- BackendController
- API resources(new feature in L5.5)
- Criteria support of Repository

### Changed
- Upgrade to L5.5
- Update materialize-css to latest 'next' version
- NPM packages
- Route names
- PHPDoc with full qualified namespace
- Refactor Repository and concrete
- FormRequest
- Refactor Repository(`4c87f6e`)
- MarkDownParser
- Upgrade composer packages

### Removed
- AdminLTE views
- Unnecessary fields of Post

### Fixed
- Fix previous and next post bug

## 0.3.0 - 2017-12-10
### Added
- Visitor history and base counter. See branch `counter` and `visitor`
Expand All @@ -27,7 +55,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Side navigation bar style

### Fixed
- Fix Postable retrieve data bug (`890c082`)
- Fix HasPost retrieve data bug (`890c082`)

## 0.2.0 - 2017-06-15
### Added
Expand Down
24 changes: 12 additions & 12 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
# Todo list of project
# Todo list

## Backend
## Recent

- [x] Category
- [x] Tag
- [x] Comment
- [x] Visitor & view count(use Middleware)
- [x] Cache
- [ ] Cache
- [ ] Email
- [ ] Notification
- [ ] Socialite
- [ ] Wechat related
- [ ] Schedule(backup,stat,)
- [ ] Schedule(backup,stats)
- [ ] I18N
- [ ] Highlight tab
- [ ] Links
- [x] Settings
- [ ] File management
- [x] Feature image
- [ ] Flash session

## Frontend

- [ ] Single Page(about page)
- [x] Materialize css
- [ ] Search
- [ ] Websocket

## Future
## Future or Enhance

- [ ] Refactor views with VueJs
- [x] Refactor views with VueJs
- [ ] API
- [ ] Package
- [ ] Unit test
- [ ] Pjax
- [ ] Upgrade to Laravel 5.5
- [x] Upgrade to Laravel 5.5
- [ ] Image resize
- [ ] CDN
- [ ] All todo
- [ ] Post edit(dynamic tags, image preview)
4 changes: 3 additions & 1 deletion app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ protected function schedule(Schedule $schedule)
}

/**
* Register the Closure based commands for the application.
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');

require base_path('routes/console.php');
}
}
36 changes: 12 additions & 24 deletions app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,27 @@
namespace App\Exceptions;

use Exception;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

class Handler extends ExceptionHandler
{
/**
* A list of the exception types that should not be reported.
* A list of the exception types that are not reported.
*
* @var array
*/
protected $dontReport = [
\Illuminate\Auth\AuthenticationException::class,
\Illuminate\Auth\Access\AuthorizationException::class,
\Symfony\Component\HttpKernel\Exception\HttpException::class,
\Illuminate\Database\Eloquent\ModelNotFoundException::class,
\Illuminate\Session\TokenMismatchException::class,
\Illuminate\Validation\ValidationException::class,
//
];

/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array
*/
protected $dontFlash = [
'password',
'password_confirmation',
];

/**
Expand All @@ -46,20 +50,4 @@ public function render($request, Exception $exception)
{
return parent::render($request, $exception);
}

/**
* Convert an authentication exception into an unauthenticated response.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Auth\AuthenticationException $exception
* @return \Illuminate\Http\Response
*/
protected function unauthenticated($request, AuthenticationException $exception)
{
if ($request->expectsJson()) {
return response()->json(['error' => 'Unauthenticated.'], 401);
}

return redirect()->guest(route('login'));
}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/RegisterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ protected function validator(array $data)
* Create a new user instance after a valid registration.
*
* @param array $data
* @return User
* @return \App\User
*/
protected function create(array $data)
{
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/Traits/AuthRedirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ trait AuthRedirect
*/
protected function redirectTo()
{
return route('admin.dashboard.index');
return route('admin.home');
}
}
16 changes: 16 additions & 0 deletions app/Http/Controllers/Backend/BackendController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace App\Http\Controllers\Backend;

use App\Http\Controllers\Backend\Traits\ApiResponse;
use App\Http\Controllers\Controller;

/**
* Class BackendController
* @package App\Http\Controllers\Backend
*/
class BackendController extends Controller
{
use ApiResponse;

}
43 changes: 24 additions & 19 deletions app/Http/Controllers/Backend/CategoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,27 @@

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
/**
* Class CategoryController
* @package App\Http\Controllers\Backend
*/
class CategoryController extends BackendController
{
protected $cateRepo;
/**
* @var CategoryRepository
*/
protected $categoryRepository;

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

/**
Expand All @@ -27,7 +32,7 @@ public function __construct(CategoryRepository $cateRepo)
*/
public function index()
{
$categories = $this->cateRepo->paginate();
$categories = $this->categoryRepository->paginate();

return view('admin.categories.index', compact('categories'));
}
Expand All @@ -46,13 +51,13 @@ public function create()
* Store a newly created resource in storage.
*
* @param StoreUpdateCategoryRequest $request
* @return \Illuminate\Http\Response
* @return \Illuminate\Http\JsonResponse
*/
public function store(StoreUpdateCategoryRequest $request)
{
$category = $this->cateRepo->createCategory($request->all());
$category = $this->categoryRepository->create($request->all());

return redirect()->route('admin.categories.index')->withSuccess('Create category successfully!');
return $this->successCreated($category);
}

/**
Expand All @@ -63,7 +68,7 @@ public function store(StoreUpdateCategoryRequest $request)
*/
public function show($id)
{
$category = $this->cateRepo->find($id);
$category = $this->categoryRepository->find($id);

return response($category);
}
Expand All @@ -76,7 +81,7 @@ public function show($id)
*/
public function edit($id)
{
$category = $this->cateRepo->find($id);
$category = $this->categoryRepository->find($id);

return view('admin.categories.edit', compact('category'));
}
Expand All @@ -86,25 +91,25 @@ public function edit($id)
*
* @param StoreUpdateCategoryRequest $request
* @param int $id
* @return \Illuminate\Http\Response
* @return \Illuminate\Http\JsonResponse
*/
public function update(StoreUpdateCategoryRequest $request, $id)
{
$category = $this->cateRepo->updateCategory($request->all(), $id);
$category = $this->categoryRepository->update($request->all(), $id);

return redirect()->route('admin.categories.index')->withSuccess('Update category successfully!');
return $this->successCreated($category);
}

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

return redirect()->route('admin.categories.index')->withSuccess('Delete category successfully!');
return $this->successDeleted();
}
}
16 changes: 1 addition & 15 deletions app/Http/Controllers/Backend/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
namespace App\Http\Controllers\Backend;

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

class DashboardController extends Controller
class DashboardController extends BackendController
{
/**
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
Expand All @@ -14,17 +13,4 @@ public function index()
{
return view('admin.home');
}

/**
* @param Request $request
* @return \Illuminate\Foundation\Application|\JellyBool\Translug\Translation|mixed|string|\translug
*/
public function autoSlug(Request $request)
{
$this->validate($request, [
'text' => 'required',
]);

return str_slug_with_cn($request->input('text'));
}
}
Loading

0 comments on commit 28118bc

Please sign in to comment.