Skip to content

Commit

Permalink
Adapt to lumen
Browse files Browse the repository at this point in the history
  • Loading branch information
guanguans committed Jun 5, 2023
1 parent fabb8c6 commit 4da739a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
26 changes: 20 additions & 6 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
* This source file is subject to the MIT license that is bundled.
*/

use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Route;

Route::group(
Expand All @@ -20,10 +19,25 @@
'as' => 'soar.bar.',
'middleware' => [],
]),
static function (Router $router): void {
$router->get('assets/stylesheets', 'AssetController@css')->name('assets.css');
$router->get('assets/javascript', 'AssetController@js')->name('assets.js');
$router->get('fonts/fontawesome-webfont.{suffix}', 'AssetController@font')->name('assets.webfont');
$router->get('fonts/FontAwesome.otf', 'AssetController@fontAwesome')->name('assets.font');
static function ($router): void {
$router->get('assets/stylesheets', [
'uses' => 'AssetController@css',
'as' => 'assets.css',
]);

$router->get('assets/javascript', [
'uses' => 'AssetController@js',
'as' => 'assets.js',
]);

$router->get('fonts/fontawesome-webfont.{suffix}', [
'uses' => 'AssetController@font',
'as' => 'assets.webfont',
]);

$router->get('fonts/FontAwesome.otf', [
'uses' => 'AssetController@fontAwesome',
'as' => 'assets.font',
]);
}
);
9 changes: 3 additions & 6 deletions src/Outputs/LogOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,15 @@

namespace Guanguans\LaravelSoar\Outputs;

use Illuminate\Log\LogManager;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;

class LogOutput extends Output
{
protected LogManager $logger;

protected string $channel;

public function __construct(LogManager $logger, string $channel = 'daily')
public function __construct(string $channel = 'daily')
{
$this->logger = $logger;
$this->channel = $channel;
}

Expand All @@ -34,7 +31,7 @@ public function __construct(LogManager $logger, string $channel = 'daily')
*/
public function output(Collection $scores, $dispatcher): void
{
$scores->each(fn (array $score) => $this->logger->channel($this->channel)->warning(
$scores->each(fn (array $score) => Log::channel($this->channel)->warning(
$score['Summary'].PHP_EOL.to_pretty_json($score)
));
}
Expand Down

0 comments on commit 4da739a

Please sign in to comment.