Code Duplication    Length = 17-24 lines in 2 locations

app/Containers/Authentication/Actions/WebLoginAction.php 1 location

@@ 15-31 (lines=17) @@
12
 *
13
 * @author Mahmoud Zalt <[email protected]>
14
 */
15
class WebLoginAction extends Action
16
{
17
18
    /**
19
     * @param \App\Ship\Transporters\DataTransporter $data
20
     *
21
     * @return  \Illuminate\Contracts\Auth\Authenticatable
22
     */
23
    public function run(DataTransporter $data): Authenticatable
24
    {
25
        $user = Apiato::call('[email protected]', [$data->email, $data->password, $data->remember]);
26
27
        Apiato::call('[email protected]', [], [['setUser' => [$user]]]);
28
29
        return $user;
30
    }
31
}
32

app/Containers/User/Actions/CreateAdminAction.php 1 location

@@ 15-38 (lines=24) @@
12
 *
13
 * @author Mahmoud Zalt <[email protected]>
14
 */
15
class CreateAdminAction extends Action
16
{
17
18
    /**
19
     * @param \App\Ship\Transporters\DataTransporter $data
20
     *
21
     * @return  \App\Containers\User\Models\User
22
     */
23
    public function run(DataTransporter $data): User
24
    {
25
        $admin = Apiato::call('[email protected]', [
26
            $isClient = false,
27
            $data->email,
28
            $data->password,
29
            $data->name
30
        ]);
31
32
        // NOTE: if not using a single general role for all Admins, comment out that line below. And assign Roles
33
        // to your users manually. (To list admins in your dashboard look for users with `is_client=false`).
34
        Apiato::call('[email protected]', [$admin, ['admin']]);
35
36
        return $admin;
37
    }
38
}
39