-
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
5 changed files
with
57 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace App\Providers; | ||
|
||
use Illuminate\Support\ServiceProvider; | ||
|
||
class LaravelPlaywrightServiceProvider extends ServiceProvider | ||
{ | ||
public function register() | ||
{ | ||
// | ||
} | ||
|
||
public function boot() | ||
{ | ||
// Playwright::alias('Carbon', fn(string $date) => \Carbon\Carbon::create($date)); | ||
// Playwright::alias('collect', fn($items) => collect(...$items)); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace Leeovery\LaravelPlaywright; | ||
|
||
use Closure; | ||
|
||
class Playwright | ||
{ | ||
public static array $aliasCallbacks = []; | ||
|
||
public static function alias(string $alias, Closure $callable): static | ||
{ | ||
static::$aliasCallbacks[$alias] = $callable; | ||
|
||
return new static; | ||
} | ||
|
||
public static function getAlias(string $alias): callable|null | ||
{ | ||
return data_get(static::$aliasCallbacks, $alias); | ||
} | ||
} |