-
Notifications
You must be signed in to change notification settings - Fork 5
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
96 changed files
with
3,464 additions
and
0 deletions.
There are no files selected for viewing
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,39 @@ | ||
APP_NAME=Laravel | ||
APP_ENV=local | ||
APP_KEY= | ||
APP_DEBUG=true | ||
APP_URL=http://localhost | ||
|
||
LOG_CHANNEL=stack | ||
|
||
DB_CONNECTION=mysql | ||
DB_HOST=127.0.0.1 | ||
DB_PORT=3306 | ||
DB_DATABASE=homestead | ||
DB_USERNAME=homestead | ||
DB_PASSWORD=secret | ||
|
||
BROADCAST_DRIVER=log | ||
CACHE_DRIVER=file | ||
SESSION_DRIVER=file | ||
SESSION_LIFETIME=120 | ||
QUEUE_DRIVER=sync | ||
|
||
REDIS_HOST=127.0.0.1 | ||
REDIS_PASSWORD=null | ||
REDIS_PORT=6379 | ||
|
||
MAIL_DRIVER=smtp | ||
MAIL_HOST=smtp.mailtrap.io | ||
MAIL_PORT=2525 | ||
MAIL_USERNAME=null | ||
MAIL_PASSWORD=null | ||
MAIL_ENCRYPTION=null | ||
|
||
PUSHER_APP_ID= | ||
PUSHER_APP_KEY= | ||
PUSHER_APP_SECRET= | ||
PUSHER_APP_CLUSTER=mt1 | ||
|
||
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" | ||
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" |
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,5 @@ | ||
* text=auto | ||
*.css linguist-vendored | ||
*.scss linguist-vendored | ||
*.js linguist-vendored | ||
CHANGELOG.md export-ignore |
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 @@ | ||
/node_modules | ||
/public/hot | ||
/public/storage | ||
/storage/*.key | ||
/vendor | ||
/.idea | ||
/.vscode | ||
/.vagrant | ||
Homestead.json | ||
Homestead.yaml | ||
npm-debug.log | ||
yarn-error.log | ||
.env |
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,42 @@ | ||
<?php | ||
|
||
namespace App\Console; | ||
|
||
use Illuminate\Console\Scheduling\Schedule; | ||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel; | ||
|
||
class Kernel extends ConsoleKernel | ||
{ | ||
/** | ||
* The Artisan commands provided by your application. | ||
* | ||
* @var array | ||
*/ | ||
protected $commands = [ | ||
// | ||
]; | ||
|
||
/** | ||
* Define the application's command schedule. | ||
* | ||
* @param \Illuminate\Console\Scheduling\Schedule $schedule | ||
* @return void | ||
*/ | ||
protected function schedule(Schedule $schedule) | ||
{ | ||
// $schedule->command('inspire') | ||
// ->hourly(); | ||
} | ||
|
||
/** | ||
* Register the commands for the application. | ||
* | ||
* @return void | ||
*/ | ||
protected function commands() | ||
{ | ||
$this->load(__DIR__.'/Commands'); | ||
|
||
require base_path('routes/console.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace App\Events\Illuminate\Database; | ||
|
||
use Illuminate\Broadcasting\Channel; | ||
use Illuminate\Queue\SerializesModels; | ||
use Illuminate\Broadcasting\PrivateChannel; | ||
use Illuminate\Broadcasting\PresenceChannel; | ||
use Illuminate\Foundation\Events\Dispatchable; | ||
use Illuminate\Broadcasting\InteractsWithSockets; | ||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast; | ||
|
||
class Events | ||
{ | ||
use Dispatchable, InteractsWithSockets, SerializesModels; | ||
|
||
/** | ||
* Create a new event instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
// | ||
} | ||
|
||
/** | ||
* Get the channels the event should broadcast on. | ||
* | ||
* @return \Illuminate\Broadcasting\Channel|array | ||
*/ | ||
public function broadcastOn() | ||
{ | ||
return new PrivateChannel('channel-name'); | ||
} | ||
} |
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,47 @@ | ||
<?php | ||
|
||
namespace App\Excels\Modules\Api; | ||
|
||
|
||
use App\Searchs\Modules\Api\Order\RepoExcelSearch; | ||
use luffyzhao\laravelTools\Excels\Facades\ExcelAbstract; | ||
|
||
class OrderExcel extends ExcelAbstract | ||
{ | ||
|
||
/** | ||
* 获取where条件 | ||
* @method getAttributes | ||
* | ||
* @return RepoExcelSearch | ||
* | ||
* @author luffyzhao@vip.126.com | ||
*/ | ||
protected function getAttributes() | ||
{ | ||
return new RepoExcelSearch( | ||
request()->all() | ||
); | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function headings(): array | ||
{ | ||
return ['订单编号']; | ||
} | ||
|
||
/** | ||
* @param mixed $row | ||
* | ||
* @return array | ||
*/ | ||
public function map($row): array | ||
{ | ||
return [ | ||
$row->order_no | ||
]; | ||
} | ||
|
||
} |
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,42 @@ | ||
<?php | ||
|
||
namespace App\Excels\Modules\Api; | ||
|
||
|
||
use luffyzhao\laravelTools\Excels\Facades\ExcelAbstract; | ||
|
||
class UserExcel extends ExcelAbstract | ||
{ | ||
|
||
/** | ||
* 获取where条件 | ||
* @method getAttributes | ||
* | ||
* @return array | ||
* | ||
* @author luffyzhao@vip.126.com | ||
*/ | ||
protected function getAttributes() | ||
{ | ||
return []; | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function headings(): array | ||
{ | ||
return []; | ||
} | ||
|
||
/** | ||
* @param mixed $row | ||
* | ||
* @return array | ||
*/ | ||
public function map($row): array | ||
{ | ||
return $row; | ||
} | ||
|
||
} |
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,51 @@ | ||
<?php | ||
|
||
namespace App\Exceptions; | ||
|
||
use Exception; | ||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; | ||
|
||
class Handler extends ExceptionHandler | ||
{ | ||
/** | ||
* A list of the exception types that are not reported. | ||
* | ||
* @var array | ||
*/ | ||
protected $dontReport = [ | ||
// | ||
]; | ||
|
||
/** | ||
* A list of the inputs that are never flashed for validation exceptions. | ||
* | ||
* @var array | ||
*/ | ||
protected $dontFlash = [ | ||
'password', | ||
'password_confirmation', | ||
]; | ||
|
||
/** | ||
* Report or log an exception. | ||
* | ||
* @param \Exception $exception | ||
* @return void | ||
*/ | ||
public function report(Exception $exception) | ||
{ | ||
parent::report($exception); | ||
} | ||
|
||
/** | ||
* Render an exception into an HTTP response. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @param \Exception $exception | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function render($request, Exception $exception) | ||
{ | ||
return parent::render($request, $exception); | ||
} | ||
} |
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,70 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Api; | ||
|
||
use App\Excels\Modules\Api\OrderExcel; | ||
use App\Searchs\Modules\Api\Order\RepoSearch; | ||
use Illuminate\Http\Request; | ||
use App\Http\Controllers\Controller; | ||
use App\Repositories\Modules\Order\Interfaces; | ||
|
||
class OrderController extends Controller | ||
{ | ||
protected $repo; | ||
|
||
public function __construct(Interfaces $repo) | ||
{ | ||
$this->repo = $repo; | ||
} | ||
|
||
/** | ||
* 测试repo:get用法 | ||
* @method repo | ||
* @return \Illuminate\Http\JsonResponse | ||
* @author luffyzhao@vip.126.com | ||
*/ | ||
public function repo() | ||
{ | ||
return $this->respondWithSuccess( | ||
$this->repo->with(['user'])->get(['*']) | ||
); | ||
} | ||
|
||
/** | ||
* 测试repo+search用法 | ||
* @method repo | ||
* @param RepoSearch $search | ||
* @return \Illuminate\Http\JsonResponse | ||
* @author luffyzhao@vip.126.com | ||
*/ | ||
public function repoSearch(RepoSearch $search) | ||
{ | ||
return $this->respondWithSuccess( | ||
$this->repo->with(['user'])->getWhere( | ||
$search, | ||
['*'] | ||
) | ||
); | ||
} | ||
|
||
/** | ||
* 测试repo+join | ||
* @method repoJoin | ||
* @return \Illuminate\Http\JsonResponse | ||
* @author luffyzhao@vip.126.com | ||
*/ | ||
public function repoJoin(){ | ||
return $this->respondWithSuccess( | ||
$this->repo->join(['user'])->get(['*']) | ||
); | ||
} | ||
|
||
/** | ||
* 测试repo+excel导出 | ||
* @method repoExcel | ||
* @author luffyzhao@vip.126.com | ||
*/ | ||
public function repoExcel(){ | ||
return (new OrderExcel($this->repo))->download('订单导出.xlsx'); | ||
} | ||
} |
Oops, something went wrong.