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
/** | |
* Converts file to base64 | |
* | |
* @param {File} file | |
* @return {Promise<String>} | |
*/ | |
export default file => { | |
return new Promise(resolve => { | |
const reader = new FileReader(); | |
reader.readAsDataURL(file); |
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
{ | |
use CreatesApplication, DatabaseMigrations, WithFaker, FactoryHelpers; | |
protected string $token; | |
protected User $user; | |
protected function setUp(): void | |
{ | |
parent::setUp(); |
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
/** | |
* Handle login | |
* | |
* @param Request $request | |
* @return JsonResponse | |
*/ | |
public function login(Request $request): JsonResponse | |
{ | |
$data = $request->validate([ | |
'email' => 'required|email', |