本文整理汇总了PHP中app\App::make方法的典型用法代码示例。如果您正苦于以下问题:PHP App::make方法的具体用法?PHP App::make怎么用?PHP App::make使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\App
的用法示例。
在下文中一共展示了App::make方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct(array $attributes = [])
{
parent::__construct($attributes);
$this->errors = new MessageBag();
$this->validator = \App::make('validator');
$this->manejaConcurrencia = true;
}
示例2: answer
/**
* @param $text
* @return $this
*/
public function answer($text)
{
if (\Config::get('gitter.output')) {
$client = \App::make(Client::class);
$room = \App::make(Room::class);
$client->request('message.send', ['roomId' => $room->id], ['text' => (string) $text], 'POST');
}
return $this;
}
示例3: storeResultsAdmin
//.........这里部分代码省略.........
// 'fragment' => 0,
// 'a' => 0,
// 'h1' => 0,
// 'title' => 0,
// 'plain-diff' => 1,
// 'plain-sample' => 0,
// 'fragment-diff' => 0,
// 'fragment-sample' => 0,
// 'a-diff' => 0,
// 'a-sample' => 0,
// 'h1-diff' => 0,
// 'h1-sample' => 0,
// 'title-diff' => 0,
// 'title-sample' => 0
// ]], $client_for_storing);
$client_for_storing = [$query => ['0' => $query, 'body' => 0, 'plain' => 1, 'fragment' => 0, 'a' => 0, 'h1' => 0, 'title' => 0, 'plain-diff' => 1, 'plain-sample' => 0, 'fragment-diff' => 0, 'fragment-sample' => 0, 'a-diff' => 0, 'a-sample' => 0, 'h1-diff' => 0, 'h1-sample' => 0, 'title-diff' => 0, 'title-sample' => 0]] + $client_for_storing;
}
}
}
foreach ($asis_info['units'] as $unit) {
$client_for_storing[$unit[0]][$unit[1]] += -1;
if ($unit[1] == 'plain') {
$client_for_storing[$unit[0]]['plain-diff'] += -1;
}
}
//delete from client-report units with only "0" values
//which can appear after subtractions
foreach ($client_for_storing as $unit => $unit_arr) {
if (array_unique(array_values($unit_arr)) == array($unit, 0)) {
unset($client_for_storing[$unit]);
}
}
//store to admin file
$excel = \App::make('excel');
$storagefile = Excel::create($filename, function ($excel) use($data_for_storing, $project, $words_admin, $refs_admin, $refs_per_query, $asis_info) {
$excel->sheet("Admin", function ($sheet) use($data_for_storing, $project, $words_admin, $refs_admin, $refs_per_query, $asis_info) {
$sheet->getStyle("C1:C999")->getAlignment()->setWrapText(true);
$sheet->freezeFirstRowAndColumn();
$sheet->fromArray($data_for_storing, null, 'A1', false, true);
$sheet->prependRow(array($project->dir));
$row_num = 1;
$sheet->setHeight($row_num, 20);
$row_num++;
$sheet->setHeight($row_num, 20);
foreach ($data_for_storing as $unit => $arr) {
$row_num++;
$sheet->setHeight($row_num, 20);
}
$sheet->appendRow($row_num + 1, $words_admin);
$sheet->setHeight($row_num + 1, 20);
$sheet->appendRow($row_num + 2, $refs_admin);
$sheet->setHeight($row_num + 2, 200);
$sheet->row($row_num + 2, function ($row) {
$row->setTextRotation(90);
});
//merge cells for queries and prepare array for inserting
$curr_column_index = 3;
$query_admin = ["", "", ""];
for ($i = 1; $i <= 5; $i++) {
//the same operation for five zones
foreach ($refs_per_query as $query => $merge_length) {
$start_cell_column = $sheet->getCellByColumnAndRow($curr_column_index, $row_num + 3)->getColumn();
$end_cell_column = $sheet->getCellByColumnAndRow($curr_column_index + $merge_length - 1, $row_num + 3)->getColumn();
$sheet->mergeCells($start_cell_column . ($row_num + 3) . ":" . $end_cell_column . ($row_num + 3));
$query_admin[] = $query;
if ($merge_length - 1 > 0) {
示例4: __construct
/**
* ShopifyService constructor.
*/
public function __construct()
{
$this->api = \App::make('ShopifyAPI');
$this->api->setup(['API_KEY' => config('app.shopify_api_key'), 'API_SECRET' => config('app.shopify_api_secret'), 'SHOP_DOMAIN' => config('app.shopify_shop_domain'), 'ACCESS_TOKEN' => config('app.shopify_access_token')]);
$this->api->installURL(['permissions' => array('read_orders', 'read_products')]);
}
示例5: addKarmaTo
/**
* @param User $user
* @param Message $message
* @return static
*/
public function addKarmaTo(User $user, Message $message)
{
return Karma::create(['room_id' => \App::make(Room::class)->id, 'message_id' => $message->gitter_id, 'user_id' => $this->id, 'user_target_id' => $user->id, 'created_at' => $message->created_at]);
}