-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use controller to respond with view
- Loading branch information
Showing
10 changed files
with
31 additions
and
21 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
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 |
---|---|---|
@@ -1,11 +1,12 @@ | ||
<?php | ||
|
||
use Illuminate\Support\Facades\Route; | ||
use Scalar\Controllers\ScalarController; | ||
|
||
Route::group([ | ||
'domain' => config('scalar.domain', null), | ||
'prefix' => config('scalar.path'), | ||
'middleware' => config('scalar.middleware', 'web'), | ||
], function () { | ||
Route::view('/', 'scalar::reference'); | ||
Route::get('/', ScalarController::class); | ||
}); |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
|
||
namespace Scalar\Scalar\Commands; | ||
namespace Scalar\Commands; | ||
|
||
use Illuminate\Console\Command; | ||
|
||
|
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 Scalar\Controllers; | ||
|
||
use Illuminate\Routing\Controller; | ||
|
||
class ScalarController extends Controller | ||
{ | ||
public function __invoke() | ||
{ | ||
return view('scalar::reference'); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
<?php | ||
|
||
namespace Scalar\Scalar\Facades; | ||
namespace Scalar\Facades; | ||
|
||
use Illuminate\Support\Facades\Facade; | ||
|
||
/** | ||
* @see \Scalar\Scalar\Scalar | ||
* @see \Scalar\Scalar | ||
*/ | ||
class Scalar extends Facade | ||
{ | ||
protected static function getFacadeAccessor(): string | ||
{ | ||
return \Scalar\Scalar\Scalar::class; | ||
return \Scalar\Scalar::class; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
|
||
namespace Scalar\Scalar; | ||
namespace Scalar; | ||
|
||
class Scalar | ||
{ | ||
|
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?php | ||
|
||
use Scalar\Scalar\Tests\TestCase; | ||
use Scalar\Tests\TestCase; | ||
|
||
uses(TestCase::class)->in(__DIR__); |
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