forked from DioBom/BomShop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,051 changed files
with
298,495 additions
and
324 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
/** | ||
* Author: Mrold | ||
* Email: <lostphper@sina.com> | ||
* Github: https://github.com/mrold | ||
* Date: 2016/6/11 | ||
* Time: 13:51 | ||
*/ | ||
|
||
namespace App\Contracts\Repositories; | ||
|
||
|
||
interface Base | ||
{ | ||
public function count(); | ||
|
||
public function all(); | ||
|
||
public function paginate($limit = null, $columns = ['*']); | ||
|
||
public function simplePaginate($limit = null, $columns = ['*']); | ||
|
||
public function first($columns = ['*']); | ||
|
||
public function find($id, $columns = ['*']); | ||
|
||
public function findOrFail($id, $columns = ['*']); | ||
|
||
public function findByField($field, $value, $columns = ['*']); | ||
|
||
public function findWhere(array $where, $columns = ['*']); | ||
|
||
public function findWhereIn($field, array $values, $columns = ['*']); | ||
|
||
public function findWhereNotIn($field, array $values, $columns = ['*']); | ||
|
||
public function create(array $attributes); | ||
|
||
public function update(array $attributes, $id); | ||
|
||
public function delete($id); | ||
|
||
public function with($relations); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
/** | ||
* Author: Mrold | ||
* Email: <lostphper@sina.com> | ||
* Github: https://github.com/mrold | ||
* Date: 2016/6/12 | ||
* Time: 11:27 | ||
*/ | ||
|
||
namespace App\Contracts\Repositories; | ||
|
||
|
||
interface Menu extends Base | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Admin; | ||
|
||
use Illuminate\Http\Request; | ||
use App\Http\Requests; | ||
use App\Services\User\User; | ||
|
||
class AdminController extends BaseController | ||
{ | ||
protected $user; | ||
|
||
public function __construct(User $user) | ||
{ | ||
parent::__construct(); | ||
|
||
$this->middleware('admin.auth:admin'); | ||
|
||
$this->user = $user; | ||
} | ||
|
||
public function index() | ||
{ | ||
return view('admin.index'); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Admin\Auth; | ||
|
||
use App\Models\User; | ||
use Validator; | ||
use Illuminate\Foundation\Auth\ThrottlesLogins; | ||
use Illuminate\Foundation\Auth\AuthenticatesUsers; | ||
use App\Http\Controllers\Admin\BaseController; | ||
|
||
class AuthController extends BaseController | ||
{ | ||
/* | ||
|-------------------------------------------------------------------------- | ||
| Registration & Login Controller | ||
|-------------------------------------------------------------------------- | ||
| | ||
| This controller handles the registration of new users, as well as the | ||
| authentication of existing users. By default, this controller uses | ||
| a simple trait to add these behaviors. Why don't you explore it? | ||
| | ||
*/ | ||
|
||
use AuthenticatesUsers, ThrottlesLogins; | ||
|
||
/** | ||
* Where to redirect users after login / registration. | ||
* | ||
* @var string | ||
*/ | ||
protected $redirectTo = 'admin'; | ||
|
||
protected $redirectAfterLogout = 'admin/login'; | ||
|
||
protected $guard = 'admin'; | ||
|
||
protected $loginView = 'admin.auth.login'; | ||
|
||
/** | ||
* Create a new authentication controller instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
|
||
$this->middleware($this->guestMiddleware(), ['except' => 'logout']); | ||
|
||
} | ||
|
||
/** | ||
* Get a validator for an incoming registration request. | ||
* | ||
* @param array $data | ||
* @return \Illuminate\Contracts\Validation\Validator | ||
*/ | ||
protected function validator(array $data) | ||
{ | ||
return Validator::make($data, [ | ||
'name' => 'required|max:255', | ||
'email' => 'required|email|max:255|unique:users', | ||
'password' => 'required|min:6|confirmed', | ||
]); | ||
} | ||
|
||
/** | ||
* Create a new user instance after a valid registration. | ||
* | ||
* @param array $data | ||
* @return User | ||
*/ | ||
protected function create(array $data) | ||
{ | ||
return User::create([ | ||
'name' => $data['name'], | ||
'email' => $data['email'], | ||
'password' => bcrypt($data['password']), | ||
]); | ||
} | ||
|
||
/** | ||
* Get the guest middleware for the application. | ||
*/ | ||
public function guestMiddleware() | ||
{ | ||
$guard = $this->getGuard(); | ||
|
||
return $guard ? 'admin.guest:'.$guard : 'admin.guest'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Admin\Auth; | ||
|
||
use App\Http\Controllers\Admin\BaseController; | ||
use Illuminate\Foundation\Auth\ResetsPasswords; | ||
|
||
class PasswordController extends BaseController | ||
{ | ||
/* | ||
|-------------------------------------------------------------------------- | ||
| Password Reset Controller | ||
|-------------------------------------------------------------------------- | ||
| | ||
| This controller is responsible for handling password reset requests | ||
| and uses a simple trait to include this behavior. You're free to | ||
| explore this trait and override any methods you wish to tweak. | ||
| | ||
*/ | ||
|
||
use ResetsPasswords; | ||
|
||
/** | ||
* Create a new password controller instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
|
||
$this->middleware('admin.guest:admin'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Admin; | ||
|
||
use Illuminate\Http\Request; | ||
|
||
use App\Http\Requests; | ||
use App\Http\Controllers\Controller; | ||
|
||
class BaseController extends Controller | ||
{ | ||
public function __construct() | ||
{ | ||
|
||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Admin; | ||
|
||
use Illuminate\Http\Request; | ||
|
||
use App\Http\Requests; | ||
use App\Http\Controllers\Controller; | ||
|
||
class UserController extends Controller | ||
{ | ||
// | ||
} |
8 changes: 4 additions & 4 deletions
8
app/Http/Controllers/Auth/AuthController.php → .../Controllers/Home/Auth/AuthController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...p/Controllers/Auth/PasswordController.php → ...trollers/Home/Auth/PasswordController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.