diff --git a/app/Classes/Modules/ControllersLogic/Accounts/ForgotAccountLogic.php b/app/Classes/Modules/ControllersLogic/Accounts/ForgotAccountLogic.php new file mode 100644 index 0000000..b71e334 --- /dev/null +++ b/app/Classes/Modules/ControllersLogic/Accounts/ForgotAccountLogic.php @@ -0,0 +1,62 @@ +createUserInvitation = $createUserInvitation; + $this->canSendAccountInvitation = $canSendAccountInvitation; + } + + + /** + * @param Request $request + * @return JsonResponse + * @throws InternalServerErrorException + */ + public function execute(Request $request) { + + try { + + $object = new UserInvitationObject($request->get('role_id'), $request->get('email')); + + if($this->canSendAccountInvitation->execute($object)){ + + + $invitation = $this->createUserInvitation->execute($object); + + event(new UserInvited($invitation)); + + return new JsonResponse("Invitation have been sent!", HttpStatus::RESOURCE_CREATED); + } + + } catch (ResourceConflictException $exception) { + throw new InternalServerErrorException("Failed to send user invitation because {$exception->getMessage()}"); + } + } +} \ No newline at end of file diff --git a/app/Http/Controllers/Account/ForgotAccountController.php b/app/Http/Controllers/Account/ForgotAccountController.php new file mode 100644 index 0000000..7f8cddb --- /dev/null +++ b/app/Http/Controllers/Account/ForgotAccountController.php @@ -0,0 +1,50 @@ +execute($request); +// } +//} + + +namespace App\Http\Controllers\Account; + +use Illuminate\Support\Facades\Mail; +use Illuminate\Http\Request; +use App\Http\Controllers\Controller; + +class ForgotAccountController extends Controller +{ + /** + * Send an e-mail reminder to the user. + * + * @param Request $request + * @param int $id + * @return Response + */ + public function forgot() + { + + Mail::send('emails.reminder', ['user' => "ahmad"], function ($m) { + $m->from('2f114cfc66-6c1272@inbox.mailtrap.io', 'Your Application'); + + $m->to("2f114cfc66-6c1272@inbox.mailtrap.io", "ahmad")->subject('Your Reminder!'); + }); + } +} \ No newline at end of file diff --git a/composer.json b/composer.json index b9d35c1..16fd021 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "laravel/laravel", + "name": "izyim/izyim", "description": "The Laravel Framework.", "keywords": ["framework", "laravel"], "license": "MIT", diff --git a/database/factories/PackageFactory.php b/database/factories/PackageFactory.php index d1cee9b..884e439 100644 --- a/database/factories/PackageFactory.php +++ b/database/factories/PackageFactory.php @@ -6,10 +6,10 @@ $factory->define(App\Models\Package::class, function (Faker $faker) { return [ 'list_id' => $faker->numberBetween(1, 300), 'description' => $faker->realText(10), - 'width' => $faker->numberBetween(1, 999), - 'length' => $faker->numberBetween(1, 999), - 'height' => $faker->numberBetween(1, 999), - 'quantity' => $faker->numberBetween(1, 50), + 'width' => $faker->numberBetween(1, 99), + 'length' => $faker->numberBetween(1, 99), + 'height' => $faker->numberBetween(1, 99), + 'quantity' => $faker->numberBetween(1, 5), 'created_at' => $faker->dateTimeBetween($startDate = '-30 days', $endDate = '30 days'), 'updated_at' => $faker->dateTimeBetween($startDate = '-30 days', $endDate = '30 days') ]; diff --git a/resources/assets/vue/components/common/AccountsSearchComponent.vue b/resources/assets/vue/components/common/AccountsSearchComponent.vue index bdda8ab..1d5a8cc 100644 --- a/resources/assets/vue/components/common/AccountsSearchComponent.vue +++ b/resources/assets/vue/components/common/AccountsSearchComponent.vue @@ -5,14 +5,14 @@
Click on the link we've sent you to reset your password. + if you have not received an email, Please check your spambox
+Reset it using your credentials
+