• You MUST read the Babiato Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.

    Our resources on Babiato Forum are CLEAN and SAFE. So you can use them for development and testing purposes. If your are on Windows and have an antivirus that alerts you about a possible infection: Know it's a false positive because all scripts are double checked by our experts. We advise you to add Babiato to trusted sites/sources or disable your antivirus momentarily while downloading a resource. "Enjoy your presence on Babiato"

ShopKing - eCommerce App with Laravel Website & Admin Panel with POS | Inventory Management

ShopKing - eCommerce App with Laravel Website & Admin Panel with POS | Inventory Management Version 1.2 (14 Mar 2024)

No permission to download
Hello friends how are you please who also has this problem: -- I connect to the admin area it is impossible for me to upload a slide or an image when I upload it loads but nothing is displayed please @zaid69 @DJJigsaw @Ashc4n
 
To fix the Signup issue, follow these steps:

Web:
Replace the file code with below code
Code:
app/Http/Controllers/Auth/SignupController.php

Modified Code:
PHP:
<?php

namespace App\Http\Controllers\Auth;

use Exception;
use App\Enums\Ask;
use Carbon\Carbon;
use App\Models\User;
use App\Enums\Activity;
use Illuminate\Support\Str;
use App\Libraries\AppLibrary;
use App\Services\MenuService;
use App\Enums\Role as EnumRole;
use Illuminate\Http\JsonResponse;
use App\Services\OtpManagerService;
use App\Services\PermissionService;
use App\Http\Controllers\Controller;
use App\Http\Requests\SignupRequest;
use App\Http\Resources\MenuResource;
use App\Http\Resources\UserResource;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
use Smartisan\Settings\Facades\Settings;
use App\Http\Requests\SignupEmailRequest;
use App\Http\Requests\SignupPhoneRequest;
use App\Http\Requests\VerifyEmailRequest;
use App\Http\Requests\VerifyPhoneRequest;
use App\Http\Resources\PermissionResource;
use Illuminate\Http\Request;

class SignupController extends Controller
{

    private OtpManagerService $otpManagerService;
    public string $token;
    public PermissionService $permissionService;
    public MenuService $menuService;

    public function __construct(OtpManagerService $otpManagerService, PermissionService $permissionService, MenuService $menuService)
    {
        $this->otpManagerService = $otpManagerService;
        $this->permissionService = $permissionService;
        $this->menuService = $menuService;
    }

    public function otpPhone(
        SignupPhoneRequest $request
    ): \Illuminate\Http\Response|\Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\Routing\ResponseFactory {
        try {
            $this->otpManagerService->otpPhone($request);
            return response(['status' => true, 'message' => trans("all.message.check_your_phone_for_code")]);
        } catch (Exception $exception) {
            return response(['status' => false, 'message' => $exception->getMessage()], 422);
        }
    }

    public function otpEmail(
        SignupEmailRequest $request
    ): \Illuminate\Http\Response|\Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\Routing\ResponseFactory {
        try {
            $this->otpManagerService->otpEmail($request);
            return response(['status' => true, 'message' => trans("all.message.check_your_email_for_code")]);
        } catch (Exception $exception) {
            return response(['status' => false, 'message' => $exception->getMessage()], 422);
        }
    }

    public function verifyPhone(
        VerifyPhoneRequest $request
    ): JsonResponse {
        try {
            $this->otpManagerService->verifyPhone($request);
         
            return new JsonResponse([
                'status' => true,
                'message' => trans('all.message.otp_verify_success')
            ]);
        } catch (Exception $exception) {
            return new JsonResponse(['status' => false, 'message' => $exception->getMessage()], 422);
        }
    }

    public function verifyEmail(
        VerifyEmailRequest $request
    ): JsonResponse {
        try {
            $this->otpManagerService->verifyEmail($request);
            return new JsonResponse([
                'status' => true,
                'message' => trans('all.message.otp_verify_success')
            ]);
        } catch (Exception $exception) {
            return new JsonResponse(['status' => false, 'message' => $exception->getMessage()], 422);
        }
    }

    public function validateRegister(SignupRequest $request)
    {
        return response(['status' => true, 'message' => trans('all.message.the_form_is_valid')]);
    }
    public function register(SignupRequest $request)
    {
        $user = User::create([
            'name' => $request->post('name'),
            'username' => Str::slug($request->post('name')) . rand(1, 500),
            'email' => $request->post('email'),
            'phone' => $request->post('phone'),
            'country_code' => $request->post('country_code'),
            'email_verified_at' => Carbon::now()->getTimestamp(),
            'is_guest' => Ask::NO,
            'password' => Hash::make($request->post('password'))
        ]);
        $user->assignRole(EnumRole::CUSTOMER);
        $user = User::where('email', $request->email)->first();

       if ($user) {
         $this->token = $user->createToken('auth_token')->plainTextToken;
         return response()->json(['status' => true, 'token' => $this->token, 'message' => trans('all.message.register_successfully')]);
       } else {
            return response(['status' => false, 'message' => trans('all.message.register_not_completed')], 422);
        }
    }

    public function signupLoginVerify(Request $request)
    {
        try {
            $user = null;
            if(isset($request->phone) && !blank($request->phone)){
                $user = User::where(['phone' => $request->phone, 'country_code' => $request->country_code])->first();
            }else{
                $user = User::where(['email' => $request->email])->first();
            }
            if ($user) {
                Auth::guard('web')->loginUsingId($user->id);
                $this->token = $user->createToken('auth_token')->plainTextToken;
                $permission = PermissionResource::collection($this->permissionService->permission($user->roles[0]));
                $defaultPermission = AppLibrary::defaultPermission($permission);
                return new JsonResponse([
                    'status' => true,
                    'message' => trans('all.message.register_successfully'),
                    'token' => $this->token,
                    'user' => new UserResource($user),
                    'menu' => MenuResource::collection(collect($this->menuService->menu($user->roles[0]))),
                    'permission' => $permission,
                    'defaultPermission' => $defaultPermission,
                ], 201);
            } else {
                return response(['status' => false, 'message' => trans('all.message.register_not_completed')], 422);
            }
        } catch (Exception $exception) {
            return new JsonResponse(['status' => false, 'message' => $exception->getMessage()], 422);
        }
    }
}

Mobile App:
Path: lib/modules/auth/controller/
Replace the files with the files attached.

Hope this helps.
 
Last edited:
  • Like
Reactions: avibe and banaaf
To fix the Signup issue, follow these steps:

Web:
Replace the file code with below code
Code:
app/Http/Controllers/Auth/SignupController.php

Modified Code:
Code:
<?php

namespace App\Http\Controllers\Auth;

use Exception;
use App\Enums\Ask;
use Carbon\Carbon;
use App\Models\User;
use App\Enums\Activity;
use Illuminate\Support\Str;
use App\Libraries\AppLibrary;
use App\Services\MenuService;
use App\Enums\Role as EnumRole;
use Illuminate\Http\JsonResponse;
use App\Services\OtpManagerService;
use App\Services\PermissionService;
use App\Http\Controllers\Controller;
use App\Http\Requests\SignupRequest;
use App\Http\Resources\MenuResource;
use App\Http\Resources\UserResource;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
use Smartisan\Settings\Facades\Settings;
use App\Http\Requests\SignupEmailRequest;
use App\Http\Requests\SignupPhoneRequest;
use App\Http\Requests\VerifyEmailRequest;
use App\Http\Requests\VerifyPhoneRequest;
use App\Http\Resources\PermissionResource;
use Illuminate\Http\Request;

class SignupController extends Controller
{

    private OtpManagerService $otpManagerService;
    public string $token;
    public PermissionService $permissionService;
    public MenuService $menuService;

    public function __construct(OtpManagerService $otpManagerService, PermissionService $permissionService, MenuService $menuService)
    {
        $this->otpManagerService = $otpManagerService;
        $this->permissionService = $permissionService;
        $this->menuService = $menuService;
    }

    public function otpPhone(
        SignupPhoneRequest $request
    ): \Illuminate\Http\Response|\Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\Routing\ResponseFactory {
        try {
            $this->otpManagerService->otpPhone($request);
            return response(['status' => true, 'message' => trans("all.message.check_your_phone_for_code")]);
        } catch (Exception $exception) {
            return response(['status' => false, 'message' => $exception->getMessage()], 422);
        }
    }

    public function otpEmail(
        SignupEmailRequest $request
    ): \Illuminate\Http\Response|\Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\Routing\ResponseFactory {
        try {
            $this->otpManagerService->otpEmail($request);
            return response(['status' => true, 'message' => trans("all.message.check_your_email_for_code")]);
        } catch (Exception $exception) {
            return response(['status' => false, 'message' => $exception->getMessage()], 422);
        }
    }

    public function verifyPhone(
        VerifyPhoneRequest $request
    ): JsonResponse {
        try {
            $this->otpManagerService->verifyPhone($request);
         
            return new JsonResponse([
                'status' => true,
                'message' => trans('all.message.otp_verify_success')
            ]);
        } catch (Exception $exception) {
            return new JsonResponse(['status' => false, 'message' => $exception->getMessage()], 422);
        }
    }

    public function verifyEmail(
        VerifyEmailRequest $request
    ): JsonResponse {
        try {
            $this->otpManagerService->verifyEmail($request);
            return new JsonResponse([
                'status' => true,
                'message' => trans('all.message.otp_verify_success')
            ]);
        } catch (Exception $exception) {
            return new JsonResponse(['status' => false, 'message' => $exception->getMessage()], 422);
        }
    }

    public function validateRegister(SignupRequest $request)
    {
        return response(['status' => true, 'message' => trans('all.message.the_form_is_valid')]);
    }
    public function register(SignupRequest $request)
    {
        $user = User::create([
            'name' => $request->post('name'),
            'username' => Str::slug($request->post('name')) . rand(1, 500),
            'email' => $request->post('email'),
            'phone' => $request->post('phone'),
            'country_code' => $request->post('country_code'),
            'email_verified_at' => Carbon::now()->getTimestamp(),
            'is_guest' => Ask::NO,
            'password' => Hash::make($request->post('password'))
        ]);
        $user->assignRole(EnumRole::CUSTOMER);
        $user = User::where('email', $request->email)->first();

       if ($user) {
         $this->token = $user->createToken('auth_token')->plainTextToken;
         return response()->json(['status' => true, 'token' => $this->token, 'message' => trans('all.message.register_successfully')]);
       } else {
            return response(['status' => false, 'message' => trans('all.message.register_not_completed')], 422);
        }
    }

    public function signupLoginVerify(Request $request)
    {
        try {
            $user = null;
            if(isset($request->phone) && !blank($request->phone)){
                $user = User::where(['phone' => $request->phone, 'country_code' => $request->country_code])->first();
            }else{
                $user = User::where(['email' => $request->email])->first();
            }
            if ($user) {
                Auth::guard('web')->loginUsingId($user->id);
                $this->token = $user->createToken('auth_token')->plainTextToken;
                $permission = PermissionResource::collection($this->permissionService->permission($user->roles[0]));
                $defaultPermission = AppLibrary::defaultPermission($permission);
                return new JsonResponse([
                    'status' => true,
                    'message' => trans('all.message.register_successfully'),
                    'token' => $this->token,
                    'user' => new UserResource($user),
                    'menu' => MenuResource::collection(collect($this->menuService->menu($user->roles[0]))),
                    'permission' => $permission,
                    'defaultPermission' => $defaultPermission,
                ], 201);
            } else {
                return response(['status' => false, 'message' => trans('all.message.register_not_completed')], 422);
            }
        } catch (Exception $exception) {
            return new JsonResponse(['status' => false, 'message' => $exception->getMessage()], 422);
        }
    }
}

Mobile App:
Path: lib/modules/auth/controller/
Replace the files with the files attached.

Hope this helps.

Thanks man 🤝
 
Do you have solution to the Hastags #
Sorry bro, I haven't found any solution for this one.
I don't know much about php/server side codes
if you need help with flutter, I can help you with it.
 
Thanks again brother
Lemme have your contact in DM,
We could possibly work on 1or2 projects
Sorry bro, I haven't found any solution for this one.
I don't know much about php/server side codes
if you need help with flutter, I can help you with it.
 
Do you have solution to the Hastags #

Weekends are bit better for me, so I will check this weekend about the coding and see what I can figure out about it. Might be hard coded, but will see though
 
open AppLibrary.php . It is in app/Libraries/AppLibrary.php

Line
Code:
open AppLibrary.php . It is in app/Libraries/AppLibrary.php


Line 110


        if ($buildArray) {
            foreach ($buildArray as $key => $build) {
                if ($build['url'] == "#" && !isset($build['children'])) {
                    unset($buildArray[$key]);
                }
            }
        }


change to


        if ($buildArray) {
            foreach ($buildArray as $key => $build) {
                if ($build['url'] == !isset($build['children'])) {
                    unset($buildArray[$key]);
                }
            }
        }


Step 2 : Database/seeders/MenuTableSeeder.php


remove URL
 
open AppLibrary.php . It is in app/Libraries/AppLibrary.php

Line
Code:
open AppLibrary.php . It is in app/Libraries/AppLibrary.php


Line 110


        if ($buildArray) {
            foreach ($buildArray as $key => $build) {
                if ($build['url'] == "#" && !isset($build['children'])) {
                    unset($buildArray[$key]);
                }
            }
        }


change to


        if ($buildArray) {
            foreach ($buildArray as $key => $build) {
                if ($build['url'] == !isset($build['children'])) {
                    unset($buildArray[$key]);
                }
            }
        }


Step 2 : Database/seeders/MenuTableSeeder.php


remove URL
What are you doing?
 
open AppLibrary.php . It is in app/Libraries/AppLibrary.php

Line
Code:
open AppLibrary.php . It is in app/Libraries/AppLibrary.php


Line 110


        if ($buildArray) {
            foreach ($buildArray as $key => $build) {
                if ($build['url'] == "#" && !isset($build['children'])) {
                    unset($buildArray[$key]);
                }
            }
        }


change to


        if ($buildArray) {
            foreach ($buildArray as $key => $build) {
                if ($build['url'] == !isset($build['children'])) {
                    unset($buildArray[$key]);
                }
            }
        }


Step 2 : Database/seeders/MenuTableSeeder.php


remove URL

before or after installation ?
and at database/seeder/menutableseeder.php
many url = # are there, do we remove all ?
 
Last edited:
ShopKing in this shopping cart web application can any one suggest where we placed the Ads script in this application files. it will show entire shopping cart nearly 3 ads top, bottom and left.

Thank You
Venkat
 
Can anyone help set up this script locally?
I'm not able to install the script on localhost. I don't have much knowledge of php and 0% knowledge of Vue. 😁
I want to make some customization.
I just need help with Local setup and after the modification how can i create production build?
As far as i know Vue projects require build to be uploaded, changes don't work without the build. If there's a way to make changes in Vue in live like we can make changes in HTML, Bootstrap in live and it works, Please let me know.
 
I'm able to set up the script locally, but now I need help of Vue and PHP dev.
The first change i wanted to make in this script is to remove /#/ from url.
I got success in this change, but now the issue is that the routes are not being accessed,
E.g: if i open any page by navigation(By clicking on any button or page link) im able to access that page, but when i refresh that page or try to access that url directly, i get error message of Url not found.
If any know the PHP and Vue Devs please mention them here.

@DJJigsaw @Babak @NullMaster

Please reply to this Thread
 
AdBlock Detected

We get it, advertisements are annoying!

However in order to keep our huge array of resources free of charge we need to generate income from ads so to use the site you will need to turn off your adblocker.

If you'd like to have an ad free experience you can become a Babiato Lover by donating as little as $5 per month. Click on the Donate menu tab for more info.

I've Disabled AdBlock