├── .editorconfig ├── .env.example ├── .gitattributes ├── .gitignore ├── README.md ├── app ├── Console │ ├── Commands │ │ ├── FreshData.php │ │ └── MakeLivewire.php │ └── Kernel.php ├── Exceptions │ └── Handler.php ├── Http │ ├── Controllers │ │ ├── Api │ │ │ ├── ContactController.php │ │ │ ├── MessageController.php │ │ │ └── SessionController.php │ │ ├── Controller.php │ │ ├── ExcelController.php │ │ └── GroupController.php │ ├── Kernel.php │ ├── Livewire │ │ ├── Auth │ │ │ ├── Login.php │ │ │ └── Logout.php │ │ ├── Docs.php │ │ ├── Docs │ │ │ ├── ChatConversation.php │ │ │ ├── ChatList.php │ │ │ ├── GroupConversation.php │ │ │ ├── GroupInfo.php │ │ │ ├── GroupList.php │ │ │ └── SendMessage.php │ │ ├── Part │ │ │ ├── Footer.php │ │ │ ├── Navbar.php │ │ │ └── Sidebar.php │ │ └── User │ │ │ ├── AddContact.php │ │ │ ├── AddDevice.php │ │ │ ├── AddMessage.php │ │ │ ├── ChangePassword.php │ │ │ ├── Contact.php │ │ │ ├── Dashboard.php │ │ │ ├── Device.php │ │ │ ├── EditContact.php │ │ │ ├── EditDevice.php │ │ │ ├── Group.php │ │ │ ├── Message.php │ │ │ ├── Modal │ │ │ └── ImportContact.php │ │ │ ├── Profile.php │ │ │ └── ScanDevice.php │ └── Middleware │ │ ├── Authenticate.php │ │ ├── EncryptCookies.php │ │ ├── PreventRequestsDuringMaintenance.php │ │ ├── RedirectIfAuthenticated.php │ │ ├── TrimStrings.php │ │ ├── TrustHosts.php │ │ ├── TrustProxies.php │ │ ├── ValidateSignature.php │ │ └── VerifyCsrfToken.php ├── Jobs │ ├── MakeMessageLog.php │ └── SendWhatsapp.php ├── Models │ ├── Contact.php │ ├── Device.php │ ├── Group.php │ ├── MessageLog.php │ └── User.php ├── Providers │ ├── AppServiceProvider.php │ ├── AuthServiceProvider.php │ ├── BroadcastServiceProvider.php │ ├── EventServiceProvider.php │ └── RouteServiceProvider.php ├── Services │ └── Baileys.php └── helpers.php ├── artisan ├── bootstrap ├── app.php └── cache │ └── .gitignore ├── composer.json ├── composer.lock ├── config ├── app.php ├── auth.php ├── broadcasting.php ├── cache.php ├── cors.php ├── database.php ├── filesystems.php ├── hashing.php ├── logging.php ├── mail.php ├── queue.php ├── sanctum.php ├── services.php ├── session.php └── view.php ├── database ├── .gitignore ├── factories │ ├── ContactFactory.php │ ├── DeviceFactory.php │ ├── GroupFactory.php │ ├── MessageLogFactory.php │ └── UserFactory.php ├── migrations │ ├── 2014_10_12_000000_create_users_table.php │ ├── 2014_10_12_100000_create_password_resets_table.php │ ├── 2019_08_19_000000_create_failed_jobs_table.php │ ├── 2019_12_14_000001_create_personal_access_tokens_table.php │ ├── 2022_11_26_042847_create_devices_table.php │ ├── 2022_11_27_075919_create_message_logs_table.php │ ├── 2022_11_28_040434_create_jobs_table.php │ ├── 2023_03_06_080507_create_groups_table.php │ └── 2023_03_07_020711_create_contacts_table.php └── seeders │ ├── ContactSeeder.php │ ├── DatabaseSeeder.php │ └── GroupSeeder.php ├── lang └── en │ ├── auth.php │ ├── pagination.php │ ├── passwords.php │ └── validation.php ├── package-lock.json ├── package.json ├── phpunit.xml ├── public ├── .htaccess ├── assets │ ├── css │ │ ├── bootstrap.min.css │ │ ├── bootstrap.min.css.map │ │ ├── now-ui-dashboard.css │ │ ├── now-ui-dashboard.css.map │ │ └── now-ui-dashboard.min.css │ ├── fonts │ │ ├── nucleo-license.md │ │ ├── nucleo-outline.eot │ │ ├── nucleo-outline.ttf │ │ ├── nucleo-outline.woff │ │ └── nucleo-outline.woff2 │ └── js │ │ ├── core │ │ ├── bootstrap.min.js │ │ ├── jquery.min.js │ │ └── popper.min.js │ │ ├── now-ui-dashboard.js │ │ ├── now-ui-dashboard.js.map │ │ ├── now-ui-dashboard.min.js │ │ └── plugins │ │ ├── bootstrap-notify.js │ │ ├── chartjs.min.js │ │ └── perfect-scrollbar.jquery.min.js ├── favicon.ico ├── index.php ├── robots.txt └── template_contact.xlsx ├── resources ├── css │ └── app.css ├── js │ ├── app.js │ └── bootstrap.js └── views │ ├── layouts │ ├── app.blade.php │ └── auth.blade.php │ ├── livewire │ ├── auth │ │ ├── login.blade.php │ │ └── logout.blade.php │ ├── docs.blade.php │ ├── docs │ │ ├── chat-conversation.blade.php │ │ ├── chat-list.blade.php │ │ ├── group-conversation.blade.php │ │ ├── group-info.blade.php │ │ ├── group-list.blade.php │ │ └── send-message.blade.php │ ├── part │ │ ├── footer.blade.php │ │ ├── navbar.blade.php │ │ └── sidebar.blade.php │ └── user │ │ ├── add-contact.blade.php │ │ ├── add-device.blade.php │ │ ├── add-message.blade.php │ │ ├── change-password.blade.php │ │ ├── contact.blade.php │ │ ├── dashboard.blade.php │ │ ├── device.blade.php │ │ ├── edit-contact.blade.php │ │ ├── edit-device.blade.php │ │ ├── group.blade.php │ │ ├── message.blade.php │ │ ├── modal │ │ └── import-contact.blade.php │ │ ├── profile.blade.php │ │ └── scan-device.blade.php │ ├── vendor │ └── livewire │ │ ├── bootstrap.blade.php │ │ ├── simple-bootstrap.blade.php │ │ ├── simple-tailwind.blade.php │ │ └── tailwind.blade.php │ └── welcome.blade.php ├── routes ├── api.php ├── channels.php ├── console.php └── web.php ├── storage ├── app │ ├── .gitignore │ └── public │ │ └── .gitignore ├── framework │ ├── .gitignore │ ├── cache │ │ ├── .gitignore │ │ └── data │ │ │ └── .gitignore │ ├── sessions │ │ └── .gitignore │ ├── testing │ │ └── .gitignore │ └── views │ │ └── .gitignore └── logs │ └── .gitignore ├── tests ├── CreatesApplication.php ├── Feature │ └── ExampleTest.php ├── TestCase.php └── Unit │ └── ExampleTest.php ├── vite.config.js └── yarn.lock /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 4 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | 14 | [*.{yml,yaml}] 15 | indent_size = 2 16 | 17 | [docker-compose.yml] 18 | indent_size = 4 19 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | APP_NAME=Zete 2 | APP_ENV=local 3 | APP_KEY= 4 | APP_DEBUG=true 5 | APP_URL=http://yourdomain.com 6 | WA_API_URL=http://example.yourdomain.com 7 | USE_JOB_QUEUE=false 8 | 9 | LOG_CHANNEL=stack 10 | LOG_DEPRECATIONS_CHANNEL=null 11 | LOG_LEVEL=debug 12 | 13 | DB_CONNECTION=mysql 14 | DB_HOST=127.0.0.1 15 | DB_PORT=3306 16 | DB_DATABASE=zete 17 | DB_USERNAME=root 18 | DB_PASSWORD= 19 | 20 | BROADCAST_DRIVER=log 21 | CACHE_DRIVER=file 22 | FILESYSTEM_DISK=local 23 | QUEUE_CONNECTION=database 24 | SESSION_DRIVER=file 25 | SESSION_LIFETIME=120 26 | 27 | MEMCACHED_HOST=127.0.0.1 28 | 29 | REDIS_HOST=127.0.0.1 30 | REDIS_PASSWORD=null 31 | REDIS_PORT=6379 32 | 33 | MAIL_MAILER=smtp 34 | MAIL_HOST=mailhog 35 | MAIL_PORT=1025 36 | MAIL_USERNAME=null 37 | MAIL_PASSWORD=null 38 | MAIL_ENCRYPTION=null 39 | MAIL_FROM_ADDRESS="hello@example.com" 40 | MAIL_FROM_NAME="${APP_NAME}" 41 | 42 | AWS_ACCESS_KEY_ID= 43 | AWS_SECRET_ACCESS_KEY= 44 | AWS_DEFAULT_REGION=us-east-1 45 | AWS_BUCKET= 46 | AWS_USE_PATH_STYLE_ENDPOINT=false 47 | 48 | PUSHER_APP_ID= 49 | PUSHER_APP_KEY= 50 | PUSHER_APP_SECRET= 51 | PUSHER_HOST= 52 | PUSHER_PORT=443 53 | PUSHER_SCHEME=https 54 | PUSHER_APP_CLUSTER=mt1 55 | 56 | VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}" 57 | VITE_PUSHER_HOST="${PUSHER_HOST}" 58 | VITE_PUSHER_PORT="${PUSHER_PORT}" 59 | VITE_PUSHER_SCHEME="${PUSHER_SCHEME}" 60 | VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" 61 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | *.blade.php diff=html 4 | *.css diff=css 5 | *.html diff=html 6 | *.md diff=markdown 7 | *.php diff=php 8 | 9 | /.github export-ignore 10 | CHANGELOG.md export-ignore 11 | .styleci.yml export-ignore 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /public/build 3 | /public/hot 4 | /public/storage 5 | /storage/*.key 6 | /vendor 7 | .env 8 | .env.backup 9 | .env.production 10 | .phpunit.result.cache 11 | Homestead.json 12 | Homestead.yaml 13 | auth.json 14 | npm-debug.log 15 | yarn-error.log 16 | /.fleet 17 | /.idea 18 | /.vscode 19 | -------------------------------------------------------------------------------- /app/Console/Commands/FreshData.php: -------------------------------------------------------------------------------- 1 | info('Running artisan migrate:fresh'); 33 | try { 34 | Artisan::call('migrate:fresh'); 35 | $this->info('Artisan migrate:fresh ran successfully.'); 36 | } catch (\Exception $e) { 37 | $this->error('Artisan migrate:fresh could not be run.'); 38 | $this->error($e->getMessage()); 39 | } 40 | $this->info('Running artisan db:seed'); 41 | try { 42 | Artisan::call('db:seed'); 43 | $this->info('Artisan db:seed ran successfully.'); 44 | } catch (\Exception $e) { 45 | $this->error('Artisan db:seed could not be run.'); 46 | $this->error($e->getMessage()); 47 | } 48 | // regenerate app key 49 | $this->info('Running artisan key:generate'); 50 | try { 51 | Artisan::call('key:generate'); 52 | $this->info('Artisan key:generate ran successfully.'); 53 | } catch (\Exception $e) { 54 | $this->error('Artisan key:generate could not be run.'); 55 | $this->error($e->getMessage()); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /app/Console/Commands/MakeLivewire.php: -------------------------------------------------------------------------------- 1 | ask('What is the name of the component?'); 32 | try { 33 | Artisan::call('make:livewire', [ 34 | 'name' => $name 35 | ]); 36 | $this->info('Livewire component created successfully.'); 37 | } catch (\Exception $e) { 38 | $this->error('Livewire component could not be created.'); 39 | $this->error($e->getMessage()); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Console/Kernel.php: -------------------------------------------------------------------------------- 1 | command('inspire')->hourly(); 19 | } 20 | 21 | /** 22 | * Register the commands for the application. 23 | * 24 | * @return void 25 | */ 26 | protected function commands() 27 | { 28 | $this->load(__DIR__.'/Commands'); 29 | 30 | require base_path('routes/console.php'); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Exceptions/Handler.php: -------------------------------------------------------------------------------- 1 | , \Psr\Log\LogLevel::*> 14 | */ 15 | protected $levels = [ 16 | // 17 | ]; 18 | 19 | /** 20 | * A list of the exception types that are not reported. 21 | * 22 | * @var array> 23 | */ 24 | protected $dontReport = [ 25 | // 26 | ]; 27 | 28 | /** 29 | * A list of the inputs that are never flashed to the session on validation exceptions. 30 | * 31 | * @var array 32 | */ 33 | protected $dontFlash = [ 34 | 'current_password', 35 | 'password', 36 | 'password_confirmation', 37 | ]; 38 | 39 | /** 40 | * Register the exception handling callbacks for the application. 41 | * 42 | * @return void 43 | */ 44 | public function register() 45 | { 46 | $this->reportable(function (Throwable $e) { 47 | // 48 | }); 49 | $this->renderable(function (\Illuminate\Auth\AuthenticationException $e, $request) { 50 | if ($request->is('api/*')) { 51 | return response()->json([ 52 | 'message' => 'Not authenticated' 53 | ], 401); 54 | } 55 | }); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /app/Http/Controllers/Api/ContactController.php: -------------------------------------------------------------------------------- 1 | device_id; 20 | $number = $request->phone; 21 | 22 | $check = Baileys::make()->checkNumber($id, $number); 23 | 24 | return response()->json($check); 25 | } 26 | 27 | /** 28 | * Block or unblock a contact based on the provided request parameters. 29 | * 30 | * @param \Illuminate\Http\Request $request The HTTP request object. 31 | * @return \Illuminate\Http\JsonResponse The JSON response containing the result of the block operation. 32 | */ 33 | public function blockContact(Request $request) 34 | { 35 | $id = $request->device_id; 36 | $number = $request->phone; 37 | $block = $request->block == 'false' ? false : true; 38 | 39 | $block = Baileys::make()->blockContact($id, $number, $block); 40 | 41 | return response()->json($block); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/Http/Controllers/Api/MessageController.php: -------------------------------------------------------------------------------- 1 | base_url = config('app.wa_api_url'); 20 | } 21 | 22 | /** 23 | * Sends a message using the provided request data. 24 | * 25 | * @param \Illuminate\Http\Request $request The request object containing the necessary data. 26 | * @return \Illuminate\Http\JsonResponse The JSON response containing the result of the message sending. 27 | */ 28 | 29 | public function send(Request $request) 30 | { 31 | if(!auth()->user()){ 32 | return response()->json([ 33 | 'status' => false, 34 | 'message' => 'Unauthorized', 35 | ], 401); 36 | } 37 | 38 | $device_id = $request->device_id; 39 | $phone = $request->phone; 40 | $message = $request->message; 41 | $device = Device::find($device_id); 42 | if(config('app.use_job_queue')){ 43 | SendWhatsapp::dispatch($device->user_id, $device_id, $phone, $message); 44 | return response()->json([ 45 | 'status' => true, 46 | 'message' => 'Message sent to queue', 47 | ], 200); 48 | } 49 | $send = Baileys::make()->sendMessage($device_id, $phone, $message); 50 | if(isset($send['result']->status) && $send['result']->status === 'PENDING') { 51 | $status = 200; 52 | } else { 53 | $status = 500; 54 | } 55 | if(config('app.use_job_queue')){ 56 | MakeMessageLog::dispatch($device_id, $phone, $message, $status); 57 | } else { 58 | MessageLog::create([ 59 | 'user_id' => $device->user_id, 60 | 'device_name' => $device->name, 61 | 'to' => $phone, 62 | 'message' => json_encode($message), 63 | 'status' => $status, 64 | ]); 65 | } 66 | return response()->json($send['result']); 67 | } 68 | 69 | /** 70 | * Retrieve a list of messages based on the provided request parameters. 71 | * 72 | * @param \Illuminate\Http\Request $request The HTTP request object. 73 | * @return \Illuminate\Http\JsonResponse The JSON response containing the list of messages. 74 | */ 75 | public function list(Request $request) 76 | { 77 | if(!auth()->user()){ 78 | return response()->json([ 79 | 'status' => false, 80 | 'message' => 'Unauthorized', 81 | ], 401); 82 | } 83 | 84 | $device_id = $request->device_id; 85 | $limit = $request->limit; 86 | $cursor = $request->cursor; 87 | 88 | $chat = Baileys::make()->listMessage($device_id, $limit, $cursor); 89 | return response()->json($chat); 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /app/Http/Controllers/Api/SessionController.php: -------------------------------------------------------------------------------- 1 | user()){ 13 | return response()->json([ 14 | 'status' => false, 15 | 'message' => 'Unauthorized', 16 | ], 401); 17 | } 18 | $id = $request->id; 19 | $status = sessionStatus($id); 20 | return response()->json($status); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/Http/Controllers/Controller.php: -------------------------------------------------------------------------------- 1 | group_import; 15 | $file = $request->file('file'); 16 | $fileName = $file->getClientOriginalName(); 17 | $file->move('uploads', $fileName); 18 | (new FastExcel)->import(public_path('/uploads/'.$file->getClientOriginalName()), function ($line) use($group) { 19 | return Contact::create([ 20 | 'name' => $line['name'], 21 | 'phone' => $line['phone'], 22 | 'group_id' => $group 23 | ]); 24 | }); 25 | unlink(public_path('/uploads/'.$file->getClientOriginalName())); 26 | return to_route('contact')->with('message', 'Contacts imported successfully.'); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Controllers/GroupController.php: -------------------------------------------------------------------------------- 1 | 15 | */ 16 | protected $middleware = [ 17 | // \App\Http\Middleware\TrustHosts::class, 18 | \App\Http\Middleware\TrustProxies::class, 19 | \Illuminate\Http\Middleware\HandleCors::class, 20 | \App\Http\Middleware\PreventRequestsDuringMaintenance::class, 21 | \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, 22 | \App\Http\Middleware\TrimStrings::class, 23 | \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, 24 | ]; 25 | 26 | /** 27 | * The application's route middleware groups. 28 | * 29 | * @var array> 30 | */ 31 | protected $middlewareGroups = [ 32 | 'web' => [ 33 | \App\Http\Middleware\EncryptCookies::class, 34 | \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, 35 | \Illuminate\Session\Middleware\StartSession::class, 36 | \Illuminate\View\Middleware\ShareErrorsFromSession::class, 37 | \App\Http\Middleware\VerifyCsrfToken::class, 38 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 39 | ], 40 | 41 | 'api' => [ 42 | // \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class, 43 | 'throttle:api', 44 | \Illuminate\Routing\Middleware\SubstituteBindings::class, 45 | ], 46 | ]; 47 | 48 | /** 49 | * The application's route middleware. 50 | * 51 | * These middleware may be assigned to groups or used individually. 52 | * 53 | * @var array 54 | */ 55 | protected $routeMiddleware = [ 56 | 'auth' => \App\Http\Middleware\Authenticate::class, 57 | 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 58 | 'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class, 59 | 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 60 | 'can' => \Illuminate\Auth\Middleware\Authorize::class, 61 | 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 62 | 'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class, 63 | 'signed' => \App\Http\Middleware\ValidateSignature::class, 64 | 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, 65 | 'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class, 66 | ]; 67 | } 68 | -------------------------------------------------------------------------------- /app/Http/Livewire/Auth/Login.php: -------------------------------------------------------------------------------- 1 | check()) { 18 | return redirect()->intended('/dashboard'); 19 | } 20 | } 21 | 22 | public function updatedEmail() 23 | { 24 | $this->validate([ 25 | 'loginKey' => 'required', 26 | ]); 27 | } 28 | 29 | public function updatedPassword() 30 | { 31 | $this->validate([ 32 | 'password' => 'required', 33 | ]); 34 | } 35 | 36 | public function login() 37 | { 38 | $this->validate([ 39 | 'loginKey' => 'required', 40 | 'password' => 'required', 41 | ]); 42 | 43 | // check what is loginkey (email, phone number or username) 44 | $check = filter_var($this->loginKey, FILTER_VALIDATE_EMAIL) ? 'email' : 'username'; 45 | 46 | if($check == 'username') { 47 | // if loginkey is username 48 | $attempt = auth()->attempt(['username' => $this->loginKey, 'password' => $this->password], $this->remember_me); 49 | if($attempt) { 50 | return redirect()->intended('/dashboard'); 51 | } else { 52 | return $this->dispatchBrowserEvent('message', ['type' => 'danger', 'message' => 'These credentials do not match our records']); 53 | } 54 | } else { 55 | // if loginkey is email 56 | $attempt = auth()->attempt(['email' => $this->loginKey, 'password' => $this->password], $this->remember_me); 57 | if($attempt){ 58 | return redirect()->to('/dashboard'); 59 | } 60 | } 61 | } 62 | 63 | public function render() 64 | { 65 | return view('livewire.auth.login')->layout('layouts.auth'); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /app/Http/Livewire/Auth/Logout.php: -------------------------------------------------------------------------------- 1 | dispatchBrowserEvent('message', ['type' => 'success', 'message' => 'Logging out...']); 12 | auth()->logout(); 13 | session()->flush(); 14 | return to_route('login'); 15 | } 16 | 17 | public function render() 18 | { 19 | return view('livewire.auth.logout'); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/Http/Livewire/Docs.php: -------------------------------------------------------------------------------- 1 | validate([ 16 | 'name' => 'required', 17 | 'phone' => 'required|unique:contacts', 18 | 'group' => 'required', 19 | ]); 20 | 21 | Contact::create([ 22 | 'name' => $this->name, 23 | 'phone' => $this->phone, 24 | 'group_id' => $this->group, 25 | ]); 26 | 27 | if($this->stay){ 28 | $this->reset(); 29 | return $this->dispatchBrowserEvent('message', ['type' => 'success', 'message' => 'Contact added']); 30 | } else { 31 | return to_route('contact')->with('message', 'Contact added'); 32 | } 33 | } 34 | 35 | public function render() 36 | { 37 | $groups = Group::all(); 38 | return view('livewire.user.add-contact', compact('groups')); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/Http/Livewire/User/AddDevice.php: -------------------------------------------------------------------------------- 1 | validate([ 17 | 'name' => 'required', 18 | 'description' => 'nullable', 19 | 'legacy' => 'required', 20 | ]); 21 | 22 | $d = Device::create([ 23 | 'user_id' => auth()->user()->id, 24 | 'name' => $this->name, 25 | 'description' => $this->description, 26 | 'status' => false, 27 | 'legacy' => false, 28 | ]); 29 | 30 | return to_route('scan-device', ['id' => $d->id])->with('message', 'Scan your device now'); 31 | } 32 | 33 | public function render() 34 | { 35 | return view('livewire.user.add-device'); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/Http/Livewire/User/AddMessage.php: -------------------------------------------------------------------------------- 1 | devices = Device::where('user_id', auth()->user()->id)->where('status', true)->get(); 48 | if(count($this->devices) > 0){ 49 | $this->device_id = $this->devices[0]->id; 50 | $this->device_name = $this->devices[0]->name; 51 | } 52 | } 53 | 54 | public function randomMessage() 55 | { 56 | $this->message = self::$randomMessage[array_rand(self::$randomMessage)]; 57 | } 58 | 59 | public function add() 60 | { 61 | if($this->device_id == ''){ 62 | return $this->addError('device_id', 'Please select a device'); 63 | } 64 | $checkDevice = Device::where('user_id', auth()->user()->id)->where('id', $this->device_id)->first(); 65 | if(!$checkDevice){ 66 | return $this->addError('device_id', 'Please select a valid device'); 67 | } 68 | $this->validate([ 69 | 'to' => 'required', 70 | 'message' => 'required', 71 | ]); 72 | if(config('app.use_job_queue')){ 73 | SendWhatsapp::dispatch(auth()->user()->id, $this->device_id, $this->to, $this->message); 74 | return $this->dispatchBrowserEvent('message', ['type' => 'success', 'message' => 'Message has been added to queue, if it not sent, please check your queue list, or check your device status']); 75 | } 76 | $send = Baileys::make()->sendMessage($this->device_id, $this->to, $this->message); 77 | if(isset($send['result']->status) && $send['result']->status === 'PENDING') { 78 | MessageLog::create([ 79 | 'user_id' => auth()->user()->id, 80 | 'device_name' => $this->device_name, 81 | 'to' => $this->to, 82 | 'message' => $send['message'], 83 | 'status' => 200 84 | ]); 85 | $this->dispatchBrowserEvent('message', ['type' => 'success', 'message' => 'Message sent successfully']); 86 | } else { 87 | MessageLog::create([ 88 | 'user_id' => auth()->user()->id, 89 | 'device_name' => $this->device_name, 90 | 'to' => $this->to, 91 | 'message' => $send['message'], 92 | 'status' => 500 93 | ]); 94 | $this->dispatchBrowserEvent('message', ['type' => 'error', 'message' => 'Message sending failed']); 95 | } 96 | $this->reset([ 97 | 'message' 98 | ]); 99 | } 100 | 101 | public function render() 102 | { 103 | return view('livewire.user.add-message'); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /app/Http/Livewire/User/ChangePassword.php: -------------------------------------------------------------------------------- 1 | validate([ 16 | 'current_password' => 'required', 17 | 'password' => 'required', 18 | 'password_confirmation' => 'required|same:password', 19 | ]); 20 | 21 | if(!auth()->user()->verifyPassword($this->current_password)){ 22 | return $this->dispatchBrowserEvent('message', ['type' => 'danger', 'message' => 'Current password is incorrect!']); 23 | } 24 | 25 | auth()->user()->update([ 26 | 'password' => bcrypt($this->password), 27 | ]); 28 | $this->reset(); 29 | return $this->dispatchBrowserEvent('message', ['type' => 'success', 'message' => 'Password updated successfully!']); 30 | } 31 | 32 | public function render() 33 | { 34 | return view('livewire.user.change-password'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/Http/Livewire/User/Contact.php: -------------------------------------------------------------------------------- 1 | '$refresh', 20 | 'clearSearch', 21 | 'delete', 22 | 'bulkSelect', 23 | 'selectVisible', 24 | 'selectAll', 25 | 'deselectAll', 26 | 'selectItem', 27 | 'deselectItem' 28 | ]; 29 | 30 | public function updatedQ() 31 | { 32 | $this->gotoPage(1); 33 | $this->deselectAll(); 34 | $this->dispatchBrowserEvent('uncheckSelectAll'); 35 | } 36 | 37 | public function updatedG() 38 | { 39 | $this->gotoPage(1); 40 | $this->deselectAll(); 41 | $this->dispatchBrowserEvent('uncheckSelectAll'); 42 | } 43 | 44 | public function updatedPerpage() 45 | { 46 | $this->resetPage(); 47 | $this->deselectAll(); 48 | $this->dispatchBrowserEvent('uncheckSelectAll'); 49 | } 50 | 51 | public function delete($id) 52 | { 53 | ContactModel::destroy($id); 54 | return $this->dispatchBrowserEvent('message', ['type' => 'success', 'message' => 'Contact deleted']); 55 | } 56 | 57 | public function bulkSelect($array) 58 | { 59 | $this->selected = $array; 60 | return $this->dispatchBrowserEvent('message', ['type' => 'success', 'message' => 'Contact selected']); 61 | } 62 | 63 | public function selectVisible($ids) 64 | { 65 | $this->selected = array_merge($this->selected, $ids); 66 | return $this->dispatchBrowserEvent('message', ['type' => 'success', 'message' => 'All visible contact selected']); 67 | } 68 | 69 | public function selectAll() 70 | { 71 | $this->selected = ContactModel::pluck('id')->toArray(); 72 | $this->dispatchBrowserEvent('checkSelectAll'); 73 | return $this->dispatchBrowserEvent('message', ['type' => 'success', 'message' => 'All contact selected']); 74 | } 75 | 76 | public function deselectAll() 77 | { 78 | $this->selected = []; 79 | } 80 | 81 | public function selectItem($id) 82 | { 83 | $this->selected[] = $id; 84 | } 85 | 86 | public function deselectItem($id) 87 | { 88 | $key = array_search($id, $this->selected); 89 | unset($this->selectedInput[$key]); 90 | } 91 | 92 | public function deleteSelected() 93 | { 94 | ContactModel::whereIn('id', $this->selected)->delete(); 95 | $this->selected = []; 96 | $this->dispatchBrowserEvent('uncheckSelectAll'); 97 | return $this->dispatchBrowserEvent('message', ['type' => 'success', 'message' => 'Contact deleted']); 98 | } 99 | 100 | public function render() 101 | { 102 | if($this->q && $this->g){ 103 | $contacts = ContactModel:: 104 | where('group_id', $this->g)-> 105 | where('name', 'like', '%'.$this->q.'%')-> 106 | orWhere('phone', 'like', '%'.$this->q.'%')-> 107 | with('group')-> 108 | paginate($this->perPage); 109 | } elseif($this->q && !$this->g){ 110 | $contacts = ContactModel:: 111 | where('name', 'like', '%'.$this->q.'%')-> 112 | orWhere('phone', 'like', '%'.$this->q.'%')-> 113 | with('group')-> 114 | paginate($this->perPage); 115 | } elseif(!$this->q && $this->g){ 116 | $contacts = ContactModel:: 117 | where('group_id', $this->g)-> 118 | with('group')-> 119 | paginate($this->perPage); 120 | } else{ 121 | $contacts = ContactModel::paginate($this->perPage); 122 | } 123 | $groups = Group::all(); 124 | return view('livewire.user.contact', compact('contacts', 'groups')); 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /app/Http/Livewire/User/Dashboard.php: -------------------------------------------------------------------------------- 1 | user()->devices; 13 | $devices = $device->count(); 14 | $connected_devices = $device->where('status', 1)->count(); 15 | $disconnected_devices = $device->where('status', 0)->count(); 16 | 17 | return view('livewire.user.dashboard', compact('devices', 'connected_devices', 'disconnected_devices')); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/Http/Livewire/User/Device.php: -------------------------------------------------------------------------------- 1 | '$refresh']; 11 | 12 | public function checkSession() 13 | { 14 | $devices = DeviceModel::where('user_id', auth()->user()->id)->get(); 15 | foreach($devices as $device) { 16 | $check = sessionStatus($device->id); 17 | if(isset($check->status)) { 18 | DeviceModel::where('id', $device->id)->update([ 19 | 'status' => 1 20 | ]); 21 | return; 22 | } else { 23 | DeviceModel::where('id', $device->id)->update([ 24 | 'status' => 0 25 | ]); 26 | return; 27 | } 28 | } 29 | } 30 | 31 | public function disconnect($id) 32 | { 33 | $d = DeviceModel::where('id', $id)->where('user_id', auth()->user()->id)->first(); 34 | if(!$d) { 35 | return to_route('device')->with('message', 'Device not found'); 36 | } 37 | $remove = removeSession($d->id); 38 | if(isset($remove->message)) { 39 | DeviceModel::where('id', $id)->update([ 40 | 'status' => 0 41 | ]); 42 | return to_route('device')->with('message', 'Session removed'); 43 | } 44 | return to_route('device')->with('message', 'Session not removed'); 45 | } 46 | 47 | public function deleteDevice($id) 48 | { 49 | $d = DeviceModel::where('id', $id)->where('user_id', auth()->user()->id)->first(); 50 | if(!$d) { 51 | return to_route('device')->with('message', 'Device not found'); 52 | } 53 | $remove = removeSession($d->id); 54 | if(isset($remove->message)) { 55 | DeviceModel::where('id', $id)->delete(); 56 | return to_route('device')->with('message', 'Device removed'); 57 | } 58 | return to_route('device')->with('message', 'Session not removed'); 59 | } 60 | 61 | public function render() 62 | { 63 | $devices = DeviceModel::where('user_id', auth()->user()->id)->get(); 64 | return view('livewire.user.device', compact('devices')); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /app/Http/Livewire/User/EditContact.php: -------------------------------------------------------------------------------- 1 | user()->id)->where('id', $id)->first(); 15 | if(!$d) { 16 | return to_route('device')->with('message', 'Device not found'); 17 | } 18 | $this->device_id = $id; 19 | $this->name = $d->name; 20 | $this->description = $d->description; 21 | $this->legacy = $d->legacy; 22 | } 23 | 24 | public function save() 25 | { 26 | $d = Device::where('user_id', auth()->user()->id)->where('id', $this->device_id)->first(); 27 | if(!$d) { 28 | return to_route('device')->with('message', 'Device not found'); 29 | } 30 | $this->validate([ 31 | 'name' => 'required', 32 | 'description' => 'nullable', 33 | 'legacy' => 'required', 34 | ]); 35 | $d->name = $this->name; 36 | $d->description = $this->description; 37 | $d->legacy = $this->legacy; 38 | $d->save(); 39 | return to_route('device')->with('message', 'Device updated'); 40 | } 41 | 42 | public function render() 43 | { 44 | return view('livewire.user.edit-device'); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /app/Http/Livewire/User/Group.php: -------------------------------------------------------------------------------- 1 | '$refresh', 18 | 'clearSearch', 19 | 'delete', 20 | ]; 21 | 22 | public function updatedQ() 23 | { 24 | $this->gotoPage(1); 25 | } 26 | 27 | public function updatedPerpage() 28 | { 29 | $this->resetPage(); 30 | } 31 | 32 | public function delete($id) 33 | { 34 | GroupModel::destroy($id); 35 | return $this->dispatchBrowserEvent('message', ['type' => 'success', 'message' => 'Contact deleted']); 36 | } 37 | 38 | public function render() 39 | { 40 | $groups = GroupModel:: 41 | where('name', 'like', '%'.$this->q.'%')-> 42 | paginate($this->perPage); 43 | return view('livewire.user.group', compact('groups')); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/Http/Livewire/User/Message.php: -------------------------------------------------------------------------------- 1 | '$refresh']; 13 | protected $paginationTheme = 'bootstrap'; 14 | 15 | public function clearLog() 16 | { 17 | MessageLogModel::where('user_id', auth()->user()->id)->delete(); 18 | $this->dispatchBrowserEvent('message', ['type' => 'success', 'message' => 'Message log cleared']); 19 | } 20 | 21 | public function render() 22 | { 23 | $message_logs = MessageLogModel::where('user_id', auth()->user()->id)->orderBy('created_at', 'DESC')->paginate(5); 24 | return view('livewire.user.message', compact('message_logs')); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Http/Livewire/User/Modal/ImportContact.php: -------------------------------------------------------------------------------- 1 | name = auth()->user()->name; 16 | $this->api_key = auth()->user()->api_key; 17 | } 18 | 19 | public function regenerateApi() 20 | { 21 | auth()->user()->tokens()->delete(); 22 | $token = auth()->user()->createToken(auth()->user()->name.'sallt'.now())->plainTextToken; 23 | auth()->user()->update([ 24 | 'api_key' => $token, 25 | ]); 26 | auth()->user()->save(); 27 | $this->api_key = auth()->user()->api_key; 28 | return $this->dispatchBrowserEvent('message', ['type' => 'success', 'message' => 'Api key regenerated successfully!']); 29 | } 30 | 31 | public function save() 32 | { 33 | $this->validate([ 34 | 'name' => 'required', 35 | ]); 36 | auth()->user()->update([ 37 | 'name' => $this->name, 38 | ]); 39 | return $this->dispatchBrowserEvent('message', ['type' => 'success', 'message' => 'Profile updated successfully!']); 40 | } 41 | 42 | public function render() 43 | { 44 | return view('livewire.user.profile'); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /app/Http/Livewire/User/ScanDevice.php: -------------------------------------------------------------------------------- 1 | first(); 24 | if(!$d) { 25 | return to_route('device')->with('message', 'Device not found'); 26 | } 27 | $this->device_id = $id; 28 | $this->legacy = $d->legacy; 29 | $this->status = $d->status; 30 | // dd($this->status); 31 | if($this->status === 0){ 32 | $this->checkSession(); 33 | $this->text = 'Loading...'; 34 | } else{ 35 | $this->text = 'Device is authenticated'; 36 | } 37 | } 38 | 39 | public function getQRData() 40 | { 41 | if(Cache::has('device_id_qr_'.$this->device_id)) { 42 | $checkTime = Cache::get('time_device_id_qr_'.$this->device_id) > time(); 43 | if($checkTime) { 44 | $this->text = 'Time left: '.(Cache::get('time_device_id_qr_'.$this->device_id) - time()); 45 | return $this->qr_data = Cache::get('device_id_qr_'.$this->device_id); 46 | } 47 | } 48 | $add = addSession($this->device_id, $this->legacy); 49 | if(isset($add->success)) { 50 | $this->show_refresh = true; 51 | return $this->text = "Please try again 20 seconds later"; 52 | } elseif (isset($add->error) && $add->error == 'Session already exists') { 53 | return removeSession($this->device_id); 54 | } else { 55 | $this->qr_data = $add->qr; 56 | Cache::put('time_device_id_qr_'.$this->device_id, now()->timestamp, 20); 57 | return Cache::put('device_id_qr_'.$this->device_id, $this->qr_data, 20); 58 | } 59 | } 60 | 61 | public function checkSession() 62 | { 63 | $check = sessionStatus($this->device_id); 64 | if(isset($check->status) && $check->status == 'AUTHENTICATED') { 65 | Device::where('id', $this->device_id)->update([ 66 | 'status' => 1 67 | ]); 68 | sleep(3); 69 | return to_route('device')->with('message', 'Device has been authenticated'); 70 | } else { 71 | Device::where('id', $this->device_id)->update([ 72 | 'status' => 0 73 | ]); 74 | $this->status = 0; 75 | $this->text = 'Device is not connected'; 76 | } 77 | } 78 | 79 | public function render() 80 | { 81 | return view('livewire.user.scan-device'); 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /app/Http/Middleware/Authenticate.php: -------------------------------------------------------------------------------- 1 | expectsJson()) { 18 | return route('login'); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /app/Http/Middleware/EncryptCookies.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /app/Http/Middleware/PreventRequestsDuringMaintenance.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /app/Http/Middleware/RedirectIfAuthenticated.php: -------------------------------------------------------------------------------- 1 | check()) { 26 | return redirect(RouteServiceProvider::HOME); 27 | } 28 | } 29 | 30 | return $next($request); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrimStrings.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | 'current_password', 16 | 'password', 17 | 'password_confirmation', 18 | ]; 19 | } 20 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrustHosts.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | public function hosts() 15 | { 16 | return [ 17 | $this->allSubdomainsOfApplicationUrl(), 18 | ]; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/Http/Middleware/TrustProxies.php: -------------------------------------------------------------------------------- 1 | |string|null 14 | */ 15 | protected $proxies; 16 | 17 | /** 18 | * The headers that should be used to detect proxies. 19 | * 20 | * @var int 21 | */ 22 | protected $headers = 23 | Request::HEADER_X_FORWARDED_FOR | 24 | Request::HEADER_X_FORWARDED_HOST | 25 | Request::HEADER_X_FORWARDED_PORT | 26 | Request::HEADER_X_FORWARDED_PROTO | 27 | Request::HEADER_X_FORWARDED_AWS_ELB; 28 | } 29 | -------------------------------------------------------------------------------- /app/Http/Middleware/ValidateSignature.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 'fbclid', 16 | // 'utm_campaign', 17 | // 'utm_content', 18 | // 'utm_medium', 19 | // 'utm_source', 20 | // 'utm_term', 21 | ]; 22 | } 23 | -------------------------------------------------------------------------------- /app/Http/Middleware/VerifyCsrfToken.php: -------------------------------------------------------------------------------- 1 | 13 | */ 14 | protected $except = [ 15 | // 16 | ]; 17 | } 18 | -------------------------------------------------------------------------------- /app/Jobs/MakeMessageLog.php: -------------------------------------------------------------------------------- 1 | user_id = $device->user_id; 25 | $this->device_name = $device->name; 26 | $this->phone = $phone; 27 | $this->message = json_encode($message); 28 | $this->status = $status; 29 | } 30 | 31 | public function handle() 32 | { 33 | MessageLog::create([ 34 | 'user_id' => $this->user_id, 35 | 'device_name' => $this->device_name, 36 | 'to' => $this->phone, 37 | 'message' => $this->message, 38 | 'status' => $this->status, 39 | ]); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/Jobs/SendWhatsapp.php: -------------------------------------------------------------------------------- 1 | user_id = $user_id; 30 | $this->device_id = $device_id; 31 | $this->phone = $phone; 32 | $this->message = $message; 33 | } 34 | 35 | /** 36 | * Execute the job. 37 | * 38 | * @return void 39 | */ 40 | public function handle() 41 | { 42 | $device = Device::find($this->device_id); 43 | $send = Baileys::make()->sendMessage($this->device_id, $this->phone, $this->message); 44 | Log::info($send); 45 | if(isset($send['result']->status) && $send['result']->status === 'PENDING') { 46 | MessageLog::create([ 47 | 'user_id' => $this->user_id, 48 | 'device_name' => $device->name, 49 | 'to' => $this->phone, 50 | 'message' => json_encode($send['message']), 51 | 'status' => 200 52 | ]); 53 | } else { 54 | MessageLog::create([ 55 | 'user_id' => $this->user_id, 56 | 'device_name' => $device->name, 57 | 'to' => $this->phone, 58 | 'message' => json_encode($send['message']), 59 | 'status' => 500 60 | ]); 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /app/Models/Contact.php: -------------------------------------------------------------------------------- 1 | belongsTo(Group::class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/Models/Device.php: -------------------------------------------------------------------------------- 1 | belongsTo(User::class); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /app/Models/Group.php: -------------------------------------------------------------------------------- 1 | hasMany(Contact::class); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/Models/MessageLog.php: -------------------------------------------------------------------------------- 1 | belongsTo(User::class); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/Models/User.php: -------------------------------------------------------------------------------- 1 | 20 | */ 21 | protected $fillable = [ 22 | 'name', 23 | 'email', 24 | 'password', 25 | 'api_key', 26 | ]; 27 | 28 | /** 29 | * The attributes that should be hidden for serialization. 30 | * 31 | * @var array 32 | */ 33 | protected $hidden = [ 34 | 'password', 35 | 'remember_token', 36 | ]; 37 | 38 | /** 39 | * The attributes that should be cast. 40 | * 41 | * @var array 42 | */ 43 | protected $casts = [ 44 | 'email_verified_at' => 'datetime', 45 | ]; 46 | 47 | static function verifyPassword($password) 48 | { 49 | return password_verify($password, auth()->user()->password); 50 | } 51 | 52 | public function devices(): HasMany 53 | { 54 | return $this->hasMany(Device::class); 55 | } 56 | 57 | public function messageLogs(): HasMany 58 | { 59 | return $this->hasMany(MessageLog::class); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /app/Providers/AppServiceProvider.php: -------------------------------------------------------------------------------- 1 | 14 | */ 15 | protected $policies = [ 16 | // 'App\Models\Model' => 'App\Policies\ModelPolicy', 17 | ]; 18 | 19 | /** 20 | * Register any authentication / authorization services. 21 | * 22 | * @return void 23 | */ 24 | public function boot() 25 | { 26 | $this->registerPolicies(); 27 | 28 | // 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/Providers/BroadcastServiceProvider.php: -------------------------------------------------------------------------------- 1 | > 16 | */ 17 | protected $listen = [ 18 | Registered::class => [ 19 | SendEmailVerificationNotification::class, 20 | ], 21 | ]; 22 | 23 | /** 24 | * Register any events for your application. 25 | * 26 | * @return void 27 | */ 28 | public function boot() 29 | { 30 | // 31 | } 32 | 33 | /** 34 | * Determine if events and listeners should be automatically discovered. 35 | * 36 | * @return bool 37 | */ 38 | public function shouldDiscoverEvents() 39 | { 40 | return false; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/Providers/RouteServiceProvider.php: -------------------------------------------------------------------------------- 1 | configureRateLimiting(); 30 | 31 | $this->routes(function () { 32 | Route::middleware('api') 33 | ->prefix('api') 34 | ->group(base_path('routes/api.php')); 35 | 36 | Route::middleware('web') 37 | ->group(base_path('routes/web.php')); 38 | }); 39 | } 40 | 41 | /** 42 | * Configure the rate limiters for the application. 43 | * 44 | * @return void 45 | */ 46 | protected function configureRateLimiting() 47 | { 48 | RateLimiter::for('api', function (Request $request) { 49 | return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip()); 50 | }); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /app/helpers.php: -------------------------------------------------------------------------------- 1 | sessionStatus($id); 14 | } 15 | } 16 | 17 | /** 18 | * Adds a session with the specified ID and legacy status. 19 | * 20 | * @param int $id The ID of the session to add. 21 | * @param bool $isLegacy The legacy status of the session. 22 | * @return mixed The response object containing the result of adding the session. 23 | */ 24 | if(! function_exists('addSession')){ 25 | function addSession($id, $isLegacy){ 26 | return Baileys::make()->addSession($id, $isLegacy); 27 | } 28 | } 29 | 30 | /** 31 | * Removes a session with the specified ID. 32 | * 33 | * @param int $id The ID of the session to remove. 34 | * @return mixed The response object containing the result of removing the session. 35 | */ 36 | if(! function_exists('removeSession')){ 37 | function removeSession($id){ 38 | return Baileys::make()->removeSession($id); 39 | } 40 | } 41 | 42 | /** 43 | * Sends a message to a receiver using the specified ID. 44 | * 45 | * @param int|string $id The ID used for sending the message. 46 | * @param string $receiver The receiver's identifier. 47 | * @param mixed $message The message content to be sent. 48 | * @return array An array containing the receiver, message, and the result of sending the message. 49 | */ 50 | if(! function_exists('sendMessage')){ 51 | function sendMessage($id, $receiver, $message){ 52 | return Baileys::make()->sendMessage($id, $receiver, $message); 53 | } 54 | } 55 | 56 | if(!function_exists('listMessage')){ 57 | function listMessage($id, $limit = null, $cursor = null){ 58 | return Baileys::make()->listMessage($id, $limit, $cursor); 59 | } 60 | } -------------------------------------------------------------------------------- /artisan: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | make(Illuminate\Contracts\Console\Kernel::class); 34 | 35 | $status = $kernel->handle( 36 | $input = new Symfony\Component\Console\Input\ArgvInput, 37 | new Symfony\Component\Console\Output\ConsoleOutput 38 | ); 39 | 40 | /* 41 | |-------------------------------------------------------------------------- 42 | | Shutdown The Application 43 | |-------------------------------------------------------------------------- 44 | | 45 | | Once Artisan has finished running, we will fire off the shutdown events 46 | | so that any final work may be done by the application before we shut 47 | | down the process. This is the last thing to happen to the request. 48 | | 49 | */ 50 | 51 | $kernel->terminate($input, $status); 52 | 53 | exit($status); 54 | -------------------------------------------------------------------------------- /bootstrap/app.php: -------------------------------------------------------------------------------- 1 | singleton( 30 | Illuminate\Contracts\Http\Kernel::class, 31 | App\Http\Kernel::class 32 | ); 33 | 34 | $app->singleton( 35 | Illuminate\Contracts\Console\Kernel::class, 36 | App\Console\Kernel::class 37 | ); 38 | 39 | $app->singleton( 40 | Illuminate\Contracts\Debug\ExceptionHandler::class, 41 | App\Exceptions\Handler::class 42 | ); 43 | 44 | /* 45 | |-------------------------------------------------------------------------- 46 | | Return The Application 47 | |-------------------------------------------------------------------------- 48 | | 49 | | This script returns the application instance. The instance is given to 50 | | the calling script so we can separate the building of the instances 51 | | from the actual running of the application and sending responses. 52 | | 53 | */ 54 | 55 | return $app; 56 | -------------------------------------------------------------------------------- /bootstrap/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "laravel/laravel", 3 | "type": "project", 4 | "description": "The Laravel Framework.", 5 | "keywords": ["framework", "laravel"], 6 | "license": "MIT", 7 | "require": { 8 | "php": "^8.1", 9 | "guzzlehttp/guzzle": "^7.2", 10 | "laravel/framework": "^9.19", 11 | "laravel/sanctum": "^3.0", 12 | "laravel/tinker": "^2.7", 13 | "livewire/livewire": "^2.10", 14 | "rap2hpoutre/fast-excel": "^5.1" 15 | }, 16 | "require-dev": { 17 | "fakerphp/faker": "^1.9.1", 18 | "laravel/pint": "^1.0", 19 | "laravel/sail": "^1.0.1", 20 | "mockery/mockery": "^1.4.4", 21 | "nunomaduro/collision": "^6.1", 22 | "phpunit/phpunit": "^9.5.10", 23 | "spatie/laravel-ignition": "^1.0" 24 | }, 25 | "autoload": { 26 | "psr-4": { 27 | "App\\": "app/", 28 | "Database\\Factories\\": "database/factories/", 29 | "Database\\Seeders\\": "database/seeders/" 30 | }, 31 | "files": [ 32 | "app/helpers.php" 33 | ] 34 | }, 35 | "autoload-dev": { 36 | "psr-4": { 37 | "Tests\\": "tests/" 38 | } 39 | }, 40 | "scripts": { 41 | "post-autoload-dump": [ 42 | "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", 43 | "@php artisan package:discover --ansi" 44 | ], 45 | "post-update-cmd": [ 46 | "@php artisan vendor:publish --tag=laravel-assets --ansi --force" 47 | ], 48 | "post-root-package-install": [ 49 | "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" 50 | ], 51 | "post-create-project-cmd": [ 52 | "@php artisan key:generate --ansi" 53 | ] 54 | }, 55 | "extra": { 56 | "laravel": { 57 | "dont-discover": [] 58 | } 59 | }, 60 | "config": { 61 | "optimize-autoloader": true, 62 | "preferred-install": "dist", 63 | "sort-packages": true, 64 | "allow-plugins": { 65 | "pestphp/pest-plugin": true 66 | } 67 | }, 68 | "minimum-stability": "dev", 69 | "prefer-stable": true 70 | } 71 | -------------------------------------------------------------------------------- /config/auth.php: -------------------------------------------------------------------------------- 1 | [ 17 | 'guard' => 'web', 18 | 'passwords' => 'users', 19 | ], 20 | 21 | /* 22 | |-------------------------------------------------------------------------- 23 | | Authentication Guards 24 | |-------------------------------------------------------------------------- 25 | | 26 | | Next, you may define every authentication guard for your application. 27 | | Of course, a great default configuration has been defined for you 28 | | here which uses session storage and the Eloquent user provider. 29 | | 30 | | All authentication drivers have a user provider. This defines how the 31 | | users are actually retrieved out of your database or other storage 32 | | mechanisms used by this application to persist your user's data. 33 | | 34 | | Supported: "session" 35 | | 36 | */ 37 | 38 | 'guards' => [ 39 | 'web' => [ 40 | 'driver' => 'session', 41 | 'provider' => 'users', 42 | ], 43 | ], 44 | 45 | /* 46 | |-------------------------------------------------------------------------- 47 | | User Providers 48 | |-------------------------------------------------------------------------- 49 | | 50 | | All authentication drivers have a user provider. This defines how the 51 | | users are actually retrieved out of your database or other storage 52 | | mechanisms used by this application to persist your user's data. 53 | | 54 | | If you have multiple user tables or models you may configure multiple 55 | | sources which represent each model / table. These sources may then 56 | | be assigned to any extra authentication guards you have defined. 57 | | 58 | | Supported: "database", "eloquent" 59 | | 60 | */ 61 | 62 | 'providers' => [ 63 | 'users' => [ 64 | 'driver' => 'eloquent', 65 | 'model' => App\Models\User::class, 66 | ], 67 | 68 | // 'users' => [ 69 | // 'driver' => 'database', 70 | // 'table' => 'users', 71 | // ], 72 | ], 73 | 74 | /* 75 | |-------------------------------------------------------------------------- 76 | | Resetting Passwords 77 | |-------------------------------------------------------------------------- 78 | | 79 | | You may specify multiple password reset configurations if you have more 80 | | than one user table or model in the application and you want to have 81 | | separate password reset settings based on the specific user types. 82 | | 83 | | The expire time is the number of minutes that each reset token will be 84 | | considered valid. This security feature keeps tokens short-lived so 85 | | they have less time to be guessed. You may change this as needed. 86 | | 87 | */ 88 | 89 | 'passwords' => [ 90 | 'users' => [ 91 | 'provider' => 'users', 92 | 'table' => 'password_resets', 93 | 'expire' => 60, 94 | 'throttle' => 60, 95 | ], 96 | ], 97 | 98 | /* 99 | |-------------------------------------------------------------------------- 100 | | Password Confirmation Timeout 101 | |-------------------------------------------------------------------------- 102 | | 103 | | Here you may define the amount of seconds before a password confirmation 104 | | times out and the user is prompted to re-enter their password via the 105 | | confirmation screen. By default, the timeout lasts for three hours. 106 | | 107 | */ 108 | 109 | 'password_timeout' => 10800, 110 | 111 | ]; 112 | -------------------------------------------------------------------------------- /config/broadcasting.php: -------------------------------------------------------------------------------- 1 | env('BROADCAST_DRIVER', 'null'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Broadcast Connections 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the broadcast connections that will be used 26 | | to broadcast events to other systems or over websockets. Samples of 27 | | each available type of connection are provided inside this array. 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'pusher' => [ 34 | 'driver' => 'pusher', 35 | 'key' => env('PUSHER_APP_KEY'), 36 | 'secret' => env('PUSHER_APP_SECRET'), 37 | 'app_id' => env('PUSHER_APP_ID'), 38 | 'options' => [ 39 | 'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com', 40 | 'port' => env('PUSHER_PORT', 443), 41 | 'scheme' => env('PUSHER_SCHEME', 'https'), 42 | 'encrypted' => true, 43 | 'useTLS' => env('PUSHER_SCHEME', 'https') === 'https', 44 | ], 45 | 'client_options' => [ 46 | // Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html 47 | ], 48 | ], 49 | 50 | 'ably' => [ 51 | 'driver' => 'ably', 52 | 'key' => env('ABLY_KEY'), 53 | ], 54 | 55 | 'redis' => [ 56 | 'driver' => 'redis', 57 | 'connection' => 'default', 58 | ], 59 | 60 | 'log' => [ 61 | 'driver' => 'log', 62 | ], 63 | 64 | 'null' => [ 65 | 'driver' => 'null', 66 | ], 67 | 68 | ], 69 | 70 | ]; 71 | -------------------------------------------------------------------------------- /config/cache.php: -------------------------------------------------------------------------------- 1 | env('CACHE_DRIVER', 'file'), 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Cache Stores 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may define all of the cache "stores" for your application as 26 | | well as their drivers. You may even define multiple stores for the 27 | | same cache driver to group types of items stored in your caches. 28 | | 29 | | Supported drivers: "apc", "array", "database", "file", 30 | | "memcached", "redis", "dynamodb", "octane", "null" 31 | | 32 | */ 33 | 34 | 'stores' => [ 35 | 36 | 'apc' => [ 37 | 'driver' => 'apc', 38 | ], 39 | 40 | 'array' => [ 41 | 'driver' => 'array', 42 | 'serialize' => false, 43 | ], 44 | 45 | 'database' => [ 46 | 'driver' => 'database', 47 | 'table' => 'cache', 48 | 'connection' => null, 49 | 'lock_connection' => null, 50 | ], 51 | 52 | 'file' => [ 53 | 'driver' => 'file', 54 | 'path' => storage_path('framework/cache/data'), 55 | ], 56 | 57 | 'memcached' => [ 58 | 'driver' => 'memcached', 59 | 'persistent_id' => env('MEMCACHED_PERSISTENT_ID'), 60 | 'sasl' => [ 61 | env('MEMCACHED_USERNAME'), 62 | env('MEMCACHED_PASSWORD'), 63 | ], 64 | 'options' => [ 65 | // Memcached::OPT_CONNECT_TIMEOUT => 2000, 66 | ], 67 | 'servers' => [ 68 | [ 69 | 'host' => env('MEMCACHED_HOST', '127.0.0.1'), 70 | 'port' => env('MEMCACHED_PORT', 11211), 71 | 'weight' => 100, 72 | ], 73 | ], 74 | ], 75 | 76 | 'redis' => [ 77 | 'driver' => 'redis', 78 | 'connection' => 'cache', 79 | 'lock_connection' => 'default', 80 | ], 81 | 82 | 'dynamodb' => [ 83 | 'driver' => 'dynamodb', 84 | 'key' => env('AWS_ACCESS_KEY_ID'), 85 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 86 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 87 | 'table' => env('DYNAMODB_CACHE_TABLE', 'cache'), 88 | 'endpoint' => env('DYNAMODB_ENDPOINT'), 89 | ], 90 | 91 | 'octane' => [ 92 | 'driver' => 'octane', 93 | ], 94 | 95 | ], 96 | 97 | /* 98 | |-------------------------------------------------------------------------- 99 | | Cache Key Prefix 100 | |-------------------------------------------------------------------------- 101 | | 102 | | When utilizing the APC, database, memcached, Redis, or DynamoDB cache 103 | | stores there might be other applications using the same cache. For 104 | | that reason, you may prefix every cache key to avoid collisions. 105 | | 106 | */ 107 | 108 | 'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'), 109 | 110 | ]; 111 | -------------------------------------------------------------------------------- /config/cors.php: -------------------------------------------------------------------------------- 1 | ['api/*', 'sanctum/csrf-cookie'], 19 | 20 | 'allowed_methods' => ['*'], 21 | 22 | 'allowed_origins' => ['*'], 23 | 24 | 'allowed_origins_patterns' => [], 25 | 26 | 'allowed_headers' => ['*'], 27 | 28 | 'exposed_headers' => [], 29 | 30 | 'max_age' => 0, 31 | 32 | 'supports_credentials' => false, 33 | 34 | ]; 35 | -------------------------------------------------------------------------------- /config/filesystems.php: -------------------------------------------------------------------------------- 1 | env('FILESYSTEM_DISK', 'local'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Filesystem Disks 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure as many filesystem "disks" as you wish, and you 24 | | may even configure multiple disks of the same driver. Defaults have 25 | | been set up for each driver as an example of the required values. 26 | | 27 | | Supported Drivers: "local", "ftp", "sftp", "s3" 28 | | 29 | */ 30 | 31 | 'disks' => [ 32 | 33 | 'local' => [ 34 | 'driver' => 'local', 35 | 'root' => storage_path('app'), 36 | 'throw' => false, 37 | ], 38 | 39 | 'public' => [ 40 | 'driver' => 'local', 41 | 'root' => storage_path('app/public'), 42 | 'url' => env('APP_URL').'/storage', 43 | 'visibility' => 'public', 44 | 'throw' => false, 45 | ], 46 | 47 | 's3' => [ 48 | 'driver' => 's3', 49 | 'key' => env('AWS_ACCESS_KEY_ID'), 50 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 51 | 'region' => env('AWS_DEFAULT_REGION'), 52 | 'bucket' => env('AWS_BUCKET'), 53 | 'url' => env('AWS_URL'), 54 | 'endpoint' => env('AWS_ENDPOINT'), 55 | 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false), 56 | 'throw' => false, 57 | ], 58 | 59 | ], 60 | 61 | /* 62 | |-------------------------------------------------------------------------- 63 | | Symbolic Links 64 | |-------------------------------------------------------------------------- 65 | | 66 | | Here you may configure the symbolic links that will be created when the 67 | | `storage:link` Artisan command is executed. The array keys should be 68 | | the locations of the links and the values should be their targets. 69 | | 70 | */ 71 | 72 | 'links' => [ 73 | public_path('storage') => storage_path('app/public'), 74 | ], 75 | 76 | ]; 77 | -------------------------------------------------------------------------------- /config/hashing.php: -------------------------------------------------------------------------------- 1 | 'bcrypt', 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Bcrypt Options 23 | |-------------------------------------------------------------------------- 24 | | 25 | | Here you may specify the configuration options that should be used when 26 | | passwords are hashed using the Bcrypt algorithm. This will allow you 27 | | to control the amount of time it takes to hash the given password. 28 | | 29 | */ 30 | 31 | 'bcrypt' => [ 32 | 'rounds' => env('BCRYPT_ROUNDS', 10), 33 | ], 34 | 35 | /* 36 | |-------------------------------------------------------------------------- 37 | | Argon Options 38 | |-------------------------------------------------------------------------- 39 | | 40 | | Here you may specify the configuration options that should be used when 41 | | passwords are hashed using the Argon algorithm. These will allow you 42 | | to control the amount of time it takes to hash the given password. 43 | | 44 | */ 45 | 46 | 'argon' => [ 47 | 'memory' => 65536, 48 | 'threads' => 1, 49 | 'time' => 4, 50 | ], 51 | 52 | ]; 53 | -------------------------------------------------------------------------------- /config/logging.php: -------------------------------------------------------------------------------- 1 | env('LOG_CHANNEL', 'stack'), 21 | 22 | /* 23 | |-------------------------------------------------------------------------- 24 | | Deprecations Log Channel 25 | |-------------------------------------------------------------------------- 26 | | 27 | | This option controls the log channel that should be used to log warnings 28 | | regarding deprecated PHP and library features. This allows you to get 29 | | your application ready for upcoming major versions of dependencies. 30 | | 31 | */ 32 | 33 | 'deprecations' => [ 34 | 'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'), 35 | 'trace' => false, 36 | ], 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Log Channels 41 | |-------------------------------------------------------------------------- 42 | | 43 | | Here you may configure the log channels for your application. Out of 44 | | the box, Laravel uses the Monolog PHP logging library. This gives 45 | | you a variety of powerful log handlers / formatters to utilize. 46 | | 47 | | Available Drivers: "single", "daily", "slack", "syslog", 48 | | "errorlog", "monolog", 49 | | "custom", "stack" 50 | | 51 | */ 52 | 53 | 'channels' => [ 54 | 'stack' => [ 55 | 'driver' => 'stack', 56 | 'channels' => ['single'], 57 | 'ignore_exceptions' => false, 58 | ], 59 | 60 | 'single' => [ 61 | 'driver' => 'single', 62 | 'path' => storage_path('logs/laravel.log'), 63 | 'level' => env('LOG_LEVEL', 'debug'), 64 | ], 65 | 66 | 'daily' => [ 67 | 'driver' => 'daily', 68 | 'path' => storage_path('logs/laravel.log'), 69 | 'level' => env('LOG_LEVEL', 'debug'), 70 | 'days' => 14, 71 | ], 72 | 73 | 'slack' => [ 74 | 'driver' => 'slack', 75 | 'url' => env('LOG_SLACK_WEBHOOK_URL'), 76 | 'username' => 'Laravel Log', 77 | 'emoji' => ':boom:', 78 | 'level' => env('LOG_LEVEL', 'critical'), 79 | ], 80 | 81 | 'papertrail' => [ 82 | 'driver' => 'monolog', 83 | 'level' => env('LOG_LEVEL', 'debug'), 84 | 'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class), 85 | 'handler_with' => [ 86 | 'host' => env('PAPERTRAIL_URL'), 87 | 'port' => env('PAPERTRAIL_PORT'), 88 | 'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'), 89 | ], 90 | ], 91 | 92 | 'stderr' => [ 93 | 'driver' => 'monolog', 94 | 'level' => env('LOG_LEVEL', 'debug'), 95 | 'handler' => StreamHandler::class, 96 | 'formatter' => env('LOG_STDERR_FORMATTER'), 97 | 'with' => [ 98 | 'stream' => 'php://stderr', 99 | ], 100 | ], 101 | 102 | 'syslog' => [ 103 | 'driver' => 'syslog', 104 | 'level' => env('LOG_LEVEL', 'debug'), 105 | ], 106 | 107 | 'errorlog' => [ 108 | 'driver' => 'errorlog', 109 | 'level' => env('LOG_LEVEL', 'debug'), 110 | ], 111 | 112 | 'null' => [ 113 | 'driver' => 'monolog', 114 | 'handler' => NullHandler::class, 115 | ], 116 | 117 | 'emergency' => [ 118 | 'path' => storage_path('logs/laravel.log'), 119 | ], 120 | ], 121 | 122 | ]; 123 | -------------------------------------------------------------------------------- /config/mail.php: -------------------------------------------------------------------------------- 1 | env('MAIL_MAILER', 'smtp'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Mailer Configurations 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure all of the mailers used by your application plus 24 | | their respective settings. Several examples have been configured for 25 | | you and you are free to add your own as your application requires. 26 | | 27 | | Laravel supports a variety of mail "transport" drivers to be used while 28 | | sending an e-mail. You will specify which one you are using for your 29 | | mailers below. You are free to add additional mailers as required. 30 | | 31 | | Supported: "smtp", "sendmail", "mailgun", "ses", 32 | | "postmark", "log", "array", "failover" 33 | | 34 | */ 35 | 36 | 'mailers' => [ 37 | 'smtp' => [ 38 | 'transport' => 'smtp', 39 | 'host' => env('MAIL_HOST', 'smtp.mailgun.org'), 40 | 'port' => env('MAIL_PORT', 587), 41 | 'encryption' => env('MAIL_ENCRYPTION', 'tls'), 42 | 'username' => env('MAIL_USERNAME'), 43 | 'password' => env('MAIL_PASSWORD'), 44 | 'timeout' => null, 45 | 'local_domain' => env('MAIL_EHLO_DOMAIN'), 46 | ], 47 | 48 | 'ses' => [ 49 | 'transport' => 'ses', 50 | ], 51 | 52 | 'mailgun' => [ 53 | 'transport' => 'mailgun', 54 | ], 55 | 56 | 'postmark' => [ 57 | 'transport' => 'postmark', 58 | ], 59 | 60 | 'sendmail' => [ 61 | 'transport' => 'sendmail', 62 | 'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'), 63 | ], 64 | 65 | 'log' => [ 66 | 'transport' => 'log', 67 | 'channel' => env('MAIL_LOG_CHANNEL'), 68 | ], 69 | 70 | 'array' => [ 71 | 'transport' => 'array', 72 | ], 73 | 74 | 'failover' => [ 75 | 'transport' => 'failover', 76 | 'mailers' => [ 77 | 'smtp', 78 | 'log', 79 | ], 80 | ], 81 | ], 82 | 83 | /* 84 | |-------------------------------------------------------------------------- 85 | | Global "From" Address 86 | |-------------------------------------------------------------------------- 87 | | 88 | | You may wish for all e-mails sent by your application to be sent from 89 | | the same address. Here, you may specify a name and address that is 90 | | used globally for all e-mails that are sent by your application. 91 | | 92 | */ 93 | 94 | 'from' => [ 95 | 'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'), 96 | 'name' => env('MAIL_FROM_NAME', 'Example'), 97 | ], 98 | 99 | /* 100 | |-------------------------------------------------------------------------- 101 | | Markdown Mail Settings 102 | |-------------------------------------------------------------------------- 103 | | 104 | | If you are using Markdown based email rendering, you may configure your 105 | | theme and component paths here, allowing you to customize the design 106 | | of the emails. Or, you may simply stick with the Laravel defaults! 107 | | 108 | */ 109 | 110 | 'markdown' => [ 111 | 'theme' => 'default', 112 | 113 | 'paths' => [ 114 | resource_path('views/vendor/mail'), 115 | ], 116 | ], 117 | 118 | ]; 119 | -------------------------------------------------------------------------------- /config/queue.php: -------------------------------------------------------------------------------- 1 | env('QUEUE_CONNECTION', 'sync'), 17 | 18 | /* 19 | |-------------------------------------------------------------------------- 20 | | Queue Connections 21 | |-------------------------------------------------------------------------- 22 | | 23 | | Here you may configure the connection information for each server that 24 | | is used by your application. A default configuration has been added 25 | | for each back-end shipped with Laravel. You are free to add more. 26 | | 27 | | Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null" 28 | | 29 | */ 30 | 31 | 'connections' => [ 32 | 33 | 'sync' => [ 34 | 'driver' => 'sync', 35 | ], 36 | 37 | 'database' => [ 38 | 'driver' => 'database', 39 | 'table' => 'jobs', 40 | 'queue' => 'default', 41 | 'retry_after' => 90, 42 | 'after_commit' => false, 43 | ], 44 | 45 | 'beanstalkd' => [ 46 | 'driver' => 'beanstalkd', 47 | 'host' => 'localhost', 48 | 'queue' => 'default', 49 | 'retry_after' => 90, 50 | 'block_for' => 0, 51 | 'after_commit' => false, 52 | ], 53 | 54 | 'sqs' => [ 55 | 'driver' => 'sqs', 56 | 'key' => env('AWS_ACCESS_KEY_ID'), 57 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 58 | 'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'), 59 | 'queue' => env('SQS_QUEUE', 'default'), 60 | 'suffix' => env('SQS_SUFFIX'), 61 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 62 | 'after_commit' => false, 63 | ], 64 | 65 | 'redis' => [ 66 | 'driver' => 'redis', 67 | 'connection' => 'default', 68 | 'queue' => env('REDIS_QUEUE', 'default'), 69 | 'retry_after' => 90, 70 | 'block_for' => null, 71 | 'after_commit' => false, 72 | ], 73 | 74 | ], 75 | 76 | /* 77 | |-------------------------------------------------------------------------- 78 | | Failed Queue Jobs 79 | |-------------------------------------------------------------------------- 80 | | 81 | | These options configure the behavior of failed queue job logging so you 82 | | can control which database and table are used to store the jobs that 83 | | have failed. You may change them to any database / table you wish. 84 | | 85 | */ 86 | 87 | 'failed' => [ 88 | 'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'), 89 | 'database' => env('DB_CONNECTION', 'mysql'), 90 | 'table' => 'failed_jobs', 91 | ], 92 | 93 | ]; 94 | -------------------------------------------------------------------------------- /config/sanctum.php: -------------------------------------------------------------------------------- 1 | explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf( 19 | '%s%s', 20 | 'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1', 21 | Sanctum::currentApplicationUrlWithPort() 22 | ))), 23 | 24 | /* 25 | |-------------------------------------------------------------------------- 26 | | Sanctum Guards 27 | |-------------------------------------------------------------------------- 28 | | 29 | | This array contains the authentication guards that will be checked when 30 | | Sanctum is trying to authenticate a request. If none of these guards 31 | | are able to authenticate the request, Sanctum will use the bearer 32 | | token that's present on an incoming request for authentication. 33 | | 34 | */ 35 | 36 | 'guard' => ['web'], 37 | 38 | /* 39 | |-------------------------------------------------------------------------- 40 | | Expiration Minutes 41 | |-------------------------------------------------------------------------- 42 | | 43 | | This value controls the number of minutes until an issued token will be 44 | | considered expired. If this value is null, personal access tokens do 45 | | not expire. This won't tweak the lifetime of first-party sessions. 46 | | 47 | */ 48 | 49 | 'expiration' => null, 50 | 51 | /* 52 | |-------------------------------------------------------------------------- 53 | | Sanctum Middleware 54 | |-------------------------------------------------------------------------- 55 | | 56 | | When authenticating your first-party SPA with Sanctum you may need to 57 | | customize some of the middleware Sanctum uses while processing the 58 | | request. You may change the middleware listed below as required. 59 | | 60 | */ 61 | 62 | 'middleware' => [ 63 | 'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class, 64 | 'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class, 65 | ], 66 | 67 | ]; 68 | -------------------------------------------------------------------------------- /config/services.php: -------------------------------------------------------------------------------- 1 | [ 18 | 'domain' => env('MAILGUN_DOMAIN'), 19 | 'secret' => env('MAILGUN_SECRET'), 20 | 'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'), 21 | 'scheme' => 'https', 22 | ], 23 | 24 | 'postmark' => [ 25 | 'token' => env('POSTMARK_TOKEN'), 26 | ], 27 | 28 | 'ses' => [ 29 | 'key' => env('AWS_ACCESS_KEY_ID'), 30 | 'secret' => env('AWS_SECRET_ACCESS_KEY'), 31 | 'region' => env('AWS_DEFAULT_REGION', 'us-east-1'), 32 | ], 33 | 34 | ]; 35 | -------------------------------------------------------------------------------- /config/view.php: -------------------------------------------------------------------------------- 1 | [ 17 | resource_path('views'), 18 | ], 19 | 20 | /* 21 | |-------------------------------------------------------------------------- 22 | | Compiled View Path 23 | |-------------------------------------------------------------------------- 24 | | 25 | | This option determines where all the compiled Blade templates will be 26 | | stored for your application. Typically, this is within the storage 27 | | directory. However, as usual, you are free to change this value. 28 | | 29 | */ 30 | 31 | 'compiled' => env( 32 | 'VIEW_COMPILED_PATH', 33 | realpath(storage_path('framework/views')) 34 | ), 35 | 36 | ]; 37 | -------------------------------------------------------------------------------- /database/.gitignore: -------------------------------------------------------------------------------- 1 | *.sqlite* 2 | -------------------------------------------------------------------------------- /database/factories/ContactFactory.php: -------------------------------------------------------------------------------- 1 | 9 | */ 10 | class ContactFactory extends Factory 11 | { 12 | /** 13 | * Define the model's default state. 14 | * 15 | * @return array 16 | */ 17 | public function definition() 18 | { 19 | return [ 20 | 'name' => $this->faker->name(), 21 | 'phone' => $this->faker->numerify('628123#######'), 22 | 'group_id' => $this->faker->numberBetween(1, 4), 23 | ]; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /database/factories/DeviceFactory.php: -------------------------------------------------------------------------------- 1 | 9 | */ 10 | class DeviceFactory extends Factory 11 | { 12 | /** 13 | * Define the model's default state. 14 | * 15 | * @return array 16 | */ 17 | public function definition() 18 | { 19 | return [ 20 | 'user_id' => 1, 21 | 'name' => fake()->name(), 22 | 'description' => fake()->words(2, true), 23 | 'status' => fake()->boolean(), 24 | ]; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /database/factories/GroupFactory.php: -------------------------------------------------------------------------------- 1 | 9 | */ 10 | class GroupFactory extends Factory 11 | { 12 | /** 13 | * Define the model's default state. 14 | * 15 | * @return array 16 | */ 17 | public function definition() 18 | { 19 | return [ 20 | 'name' => $this->faker->randomElement(['Hearts', 'Diamonds', 'Clubs', 'Spades']), 21 | ]; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /database/factories/MessageLogFactory.php: -------------------------------------------------------------------------------- 1 | 9 | */ 10 | class MessageLogFactory extends Factory 11 | { 12 | /** 13 | * Define the model's default state. 14 | * 15 | * @return array 16 | */ 17 | public function definition() 18 | { 19 | return [ 20 | 'user_id' => 1, 21 | 'device_name' => $this->faker->word, 22 | 'to' => $this->faker->phoneNumber(), 23 | 'message' => $this->faker->text(), 24 | 'status' => 200, 25 | 'created_at' => now(), 26 | ]; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /database/factories/UserFactory.php: -------------------------------------------------------------------------------- 1 | 10 | */ 11 | class UserFactory extends Factory 12 | { 13 | /** 14 | * Define the model's default state. 15 | * 16 | * @return array 17 | */ 18 | public function definition() 19 | { 20 | return [ 21 | 'name' => fake()->name(), 22 | 'email' => fake()->unique()->safeEmail(), 23 | 'username' => fake()->unique()->userName(), 24 | 'email_verified_at' => now(), 25 | 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password 26 | 'remember_token' => Str::random(10), 27 | ]; 28 | } 29 | 30 | /** 31 | * Indicate that the model's email address should be unverified. 32 | * 33 | * @return static 34 | */ 35 | public function unverified() 36 | { 37 | return $this->state(fn (array $attributes) => [ 38 | 'email_verified_at' => null, 39 | ]); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_000000_create_users_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('name'); 19 | $table->string('username'); 20 | $table->string('email')->unique(); 21 | $table->timestamp('email_verified_at')->nullable(); 22 | $table->string('password'); 23 | $table->string('api_key')->nullable(); 24 | $table->rememberToken(); 25 | $table->timestamps(); 26 | }); 27 | } 28 | 29 | /** 30 | * Reverse the migrations. 31 | * 32 | * @return void 33 | */ 34 | public function down() 35 | { 36 | Schema::dropIfExists('users'); 37 | } 38 | }; 39 | -------------------------------------------------------------------------------- /database/migrations/2014_10_12_100000_create_password_resets_table.php: -------------------------------------------------------------------------------- 1 | string('email')->index(); 18 | $table->string('token'); 19 | $table->timestamp('created_at')->nullable(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('password_resets'); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /database/migrations/2019_08_19_000000_create_failed_jobs_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('uuid')->unique(); 19 | $table->text('connection'); 20 | $table->text('queue'); 21 | $table->longText('payload'); 22 | $table->longText('exception'); 23 | $table->timestamp('failed_at')->useCurrent(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('failed_jobs'); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->morphs('tokenable'); 19 | $table->string('name'); 20 | $table->string('token', 64)->unique(); 21 | $table->text('abilities')->nullable(); 22 | $table->timestamp('last_used_at')->nullable(); 23 | $table->timestamp('expires_at')->nullable(); 24 | $table->timestamps(); 25 | }); 26 | } 27 | 28 | /** 29 | * Reverse the migrations. 30 | * 31 | * @return void 32 | */ 33 | public function down() 34 | { 35 | Schema::dropIfExists('personal_access_tokens'); 36 | } 37 | }; 38 | -------------------------------------------------------------------------------- /database/migrations/2022_11_26_042847_create_devices_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->foreignId('user_id')->constrained()->onDelete('cascade'); 19 | $table->string('name'); 20 | $table->string('description')->nullable(); 21 | $table->boolean('status')->default(false); 22 | $table->boolean('legacy')->default(false); 23 | $table->timestamps(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('devices'); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /database/migrations/2022_11_27_075919_create_message_logs_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->foreignId('user_id')->constrained(); 19 | $table->string('device_name'); 20 | $table->string('to'); 21 | $table->text('message'); 22 | $table->integer('status'); 23 | $table->timestamp('created_at')->useCurrent(); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('message_logs'); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /database/migrations/2022_11_28_040434_create_jobs_table.php: -------------------------------------------------------------------------------- 1 | bigIncrements('id'); 18 | $table->string('queue')->index(); 19 | $table->longText('payload'); 20 | $table->unsignedTinyInteger('attempts'); 21 | $table->unsignedInteger('reserved_at')->nullable(); 22 | $table->unsignedInteger('available_at'); 23 | $table->unsignedInteger('created_at'); 24 | }); 25 | } 26 | 27 | /** 28 | * Reverse the migrations. 29 | * 30 | * @return void 31 | */ 32 | public function down() 33 | { 34 | Schema::dropIfExists('jobs'); 35 | } 36 | }; 37 | -------------------------------------------------------------------------------- /database/migrations/2023_03_06_080507_create_groups_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('name'); 19 | $table->timestamps(); 20 | }); 21 | } 22 | 23 | /** 24 | * Reverse the migrations. 25 | * 26 | * @return void 27 | */ 28 | public function down() 29 | { 30 | Schema::dropIfExists('groups'); 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /database/migrations/2023_03_07_020711_create_contacts_table.php: -------------------------------------------------------------------------------- 1 | id(); 18 | $table->string('name'); 19 | $table->string('phone'); 20 | $table->foreignId('group_id')->nullable()->constrained()->onDelete('set null'); 21 | $table->timestamps(); 22 | }); 23 | } 24 | 25 | /** 26 | * Reverse the migrations. 27 | * 28 | * @return void 29 | */ 30 | public function down() 31 | { 32 | Schema::dropIfExists('contacts'); 33 | } 34 | }; 35 | -------------------------------------------------------------------------------- /database/seeders/ContactSeeder.php: -------------------------------------------------------------------------------- 1 | create(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /database/seeders/DatabaseSeeder.php: -------------------------------------------------------------------------------- 1 | create([ 20 | 'name' => 'Admin', 21 | 'email' => 'admin@admin.com', 22 | 'username' => 'admin', 23 | 'password' => bcrypt('123'), 24 | ]); 25 | $admin->api_key = $admin->createToken('admin')->plainTextToken; 26 | $admin->save(); 27 | // Device::factory(5)->create(); 28 | MessageLog::factory(25)->create(); 29 | 30 | $this->call([ 31 | GroupSeeder::class, 32 | ContactSeeder::class, 33 | ]); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /database/seeders/GroupSeeder.php: -------------------------------------------------------------------------------- 1 | 'Hearts']); 19 | Group::create(['name' => 'Diamonds']); 20 | Group::create(['name' => 'Clubs']); 21 | Group::create(['name' => 'Spades']); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lang/en/auth.php: -------------------------------------------------------------------------------- 1 | 'These credentials do not match our records.', 17 | 'password' => 'The provided password is incorrect.', 18 | 'throttle' => 'Too many login attempts. Please try again in :seconds seconds.', 19 | 20 | ]; 21 | -------------------------------------------------------------------------------- /lang/en/pagination.php: -------------------------------------------------------------------------------- 1 | '« Previous', 17 | 'next' => 'Next »', 18 | 19 | ]; 20 | -------------------------------------------------------------------------------- /lang/en/passwords.php: -------------------------------------------------------------------------------- 1 | 'Your password has been reset!', 17 | 'sent' => 'We have emailed your password reset link!', 18 | 'throttled' => 'Please wait before retrying.', 19 | 'token' => 'This password reset token is invalid.', 20 | 'user' => "We can't find a user with that email address.", 21 | 22 | ]; 23 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "dev": "vite", 5 | "build": "vite build" 6 | }, 7 | "devDependencies": { 8 | "@defstudio/vite-livewire-plugin": "^0.2.6", 9 | "axios": "^1.1.2", 10 | "laravel-vite-plugin": "^0.7.0", 11 | "lodash": "^4.17.19", 12 | "postcss": "^8.1.14", 13 | "vite": "^3.0.0" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | ./tests/Unit 10 | 11 | 12 | ./tests/Feature 13 | 14 | 15 | 16 | 17 | ./app 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /public/.htaccess: -------------------------------------------------------------------------------- 1 | 2 | 3 | Options -MultiViews -Indexes 4 | 5 | 6 | RewriteEngine On 7 | 8 | # Handle Authorization Header 9 | RewriteCond %{HTTP:Authorization} . 10 | RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] 11 | 12 | # Redirect Trailing Slashes If Not A Folder... 13 | RewriteCond %{REQUEST_FILENAME} !-d 14 | RewriteCond %{REQUEST_URI} (.+)/$ 15 | RewriteRule ^ %1 [L,R=301] 16 | 17 | # Send Requests To Front Controller... 18 | RewriteCond %{REQUEST_FILENAME} !-d 19 | RewriteCond %{REQUEST_FILENAME} !-f 20 | RewriteRule ^ index.php [L] 21 | 22 | -------------------------------------------------------------------------------- /public/assets/fonts/nucleo-outline.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cinderjk/zete/daa40f4e339006407d30ccdc739dd3d245d70041/public/assets/fonts/nucleo-outline.eot -------------------------------------------------------------------------------- /public/assets/fonts/nucleo-outline.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cinderjk/zete/daa40f4e339006407d30ccdc739dd3d245d70041/public/assets/fonts/nucleo-outline.ttf -------------------------------------------------------------------------------- /public/assets/fonts/nucleo-outline.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cinderjk/zete/daa40f4e339006407d30ccdc739dd3d245d70041/public/assets/fonts/nucleo-outline.woff -------------------------------------------------------------------------------- /public/assets/fonts/nucleo-outline.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cinderjk/zete/daa40f4e339006407d30ccdc739dd3d245d70041/public/assets/fonts/nucleo-outline.woff2 -------------------------------------------------------------------------------- /public/assets/js/now-ui-dashboard.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["_site_dashboard_free/assets/js/dashboard-free.js"],"names":["isWindows","navigator","platform","indexOf","PerfectScrollbar","$","addClass","toggle_initialized","sidebar_mini_active","backgroundOrange","navbar_initialized","fixedTop","transparentDemo","transparent","is_iPad","userAgent","match","scrollElement","window","hexToRGB","hex","alpha","r","parseInt","slice","g","b","seq","delays","durations","seq2","delays2","durations2","document","ready","length","on","this","closest","removeClass","$navbar","scroll_distance","attr","nowuiDashboard","checkScrollForTransparentNavbar","parent","each","$this","data_on_label","data","data_off_label","bootstrapSwitch","onText","offText","$toggle","misc","navbar_menu_visible","setTimeout","remove","div","appendTo","click","resize","isExpanded","find","hasClass","width","scrollTop","showNotification","from","align","color","notify","icon","message","type","timer","placement"],"mappings":"CAkCA,WAGI,GAFAA,WAAiD,EAArCC,UAAUC,SAASC,QAAQ,OAEnCH,UAAU,CAEF,IAAII,iBAAiB,oBACpB,IAAIA,iBAAiB,eAE/BC,EAAE,QAAQC,SAAS,6BAEnBD,EAAE,QAAQC,SAAS,yBAV1B,GAqBAC,mBADAC,oBADAC,iBADAC,mBAFAC,WADAC,gBADAC,aAAc,GASd,IAAIC,QAAgD,MAAtCb,UAAUc,UAAUC,MAAM,SACpCC,eAAqD,EAArChB,UAAUC,SAASC,QAAQ,OAAcE,EAAE,eAAeA,EAAEa,QAyHhF,SAASC,SAASC,EAAKC,GACnB,IAAIC,EAAIC,SAASH,EAAII,MAAM,EAAG,GAAI,IAC9BC,EAAIF,SAASH,EAAII,MAAM,EAAG,GAAI,IAC9BE,EAAIH,SAASH,EAAII,MAAM,EAAG,GAAI,IAElC,OAAIH,EACO,QAAUC,EAAI,KAAOG,EAAI,KAAOC,EAAI,KAAOL,EAAQ,IAEnD,OAASC,EAAI,KAAOG,EAAI,KAAOC,EAAI,IA/HlDC,IAAM,EAAGC,OAAS,GAAIC,UAAY,IAClCC,KAAO,EAAGC,QAAU,GAAIC,WAAa,IAErC3B,EAAE4B,UAAUC,MAAM,WAEoB,GAAhC7B,EAAE,oBAAoB8B,QAAuC,GAAxB9B,EAAE,YAAY8B,QAErD9B,EAAE,aAAa+B,GAAG,mBAAoB,WAClC/B,EAAEgC,MAAMC,QAAQ,WAAWC,YAAY,sBAAsBjC,SAAS,cACvE8B,GAAG,mBAAoB,WACtB/B,EAAEgC,MAAMC,QAAQ,WAAWhC,SAAS,sBAAsBiC,YAAY,cAI5EC,QAAUnC,EAAE,4BACZoC,gBAAkBD,QAAQE,KAAK,oBAAsB,IAGV,GAAxCrC,EAAE,4BAA4B8B,SAC7BQ,eAAeC,kCACfvC,EAAEa,QAAQkB,GAAG,SAAUO,eAAeC,kCAG1CvC,EAAE,iBAAiB+B,GAAG,QAAS,WAC3B/B,EAAEgC,MAAMQ,OAAO,gBAAgBvC,SAAS,uBACzC8B,GAAG,OAAQ,WACV/B,EAAEgC,MAAMQ,OAAO,gBAAgBN,YAAY,uBAI/ClC,EAAE,qBAAqByC,KAAK,WACxBC,MAAQ1C,EAAEgC,MACVW,cAAgBD,MAAME,KAAK,aAAe,GAC1CC,eAAiBH,MAAME,KAAK,cAAgB,GAE5CF,MAAMI,gBAAgB,CAClBC,OAAQJ,cACRK,QAASH,qBAKnB7C,EAAE4B,UAAUG,GAAG,QAAS,iBAAkB,WACtCkB,QAAUjD,EAAEgC,MAEkC,GAA3CM,eAAeY,KAAKC,qBACnBnD,EAAE,QAAQkC,YAAY,YACtBI,eAAeY,KAAKC,oBAAsB,EAC1CC,WAAW,WACPH,QAAQf,YAAY,WACpBlC,EAAE,cAAcqD,UACjB,OAGHD,WAAW,WACPH,QAAQhD,SAAS,YAClB,KAEHqD,IAAM,6BACNtD,EAAEsD,KAAKC,SAAS,QAAQC,MAAM,WAC1BxD,EAAE,QAAQkC,YAAY,YACtBI,eAAeY,KAAKC,oBAAsB,EACtCC,WAAW,WACPH,QAAQf,YAAY,WACpBlC,EAAE,cAAcqD,UAClB,OAGVrD,EAAE,QAAQC,SAAS,YACnBqC,eAAeY,KAAKC,oBAAsB,KAIlDnD,EAAEa,QAAQ4C,OAAO,WAEbnC,IAAMG,KAAO,EAEsB,GAAhCzB,EAAE,oBAAoB8B,QAAuC,GAAxB9B,EAAE,YAAY8B,SAEpDK,QAAUnC,EAAE,WACZ0D,WAAa1D,EAAE,WAAW2D,KAAK,4BAA4BtB,KAAK,iBAC5DF,QAAQyB,SAAS,aAAmC,IAApB5D,EAAEa,QAAQgD,QACX,GAA7BjD,cAAckD,aAChB3B,QAAQD,YAAY,YAAYjC,SAAS,sBAElCkC,QAAQyB,SAAS,uBAAyB5D,EAAEa,QAAQgD,QAAU,KAAqB,SAAdH,YAC9EvB,QAAQlC,SAAS,YAAYiC,YAAY,uBAG1CzB,SACDT,EAAE,QAAQkC,YAAY,kBAI5BI,eAAiB,CACfY,KAAK,CACDC,oBAAqB,GAGzBY,iBAAkB,SAASC,EAAMC,GAC7BC,MAAQ,UAERlE,EAAEmE,OAAO,CACLC,KAAM,4BACNC,QAAS,qFAET,CACEC,KAAMJ,MACNK,MAAO,IACPC,UAAW,CACPR,KAAMA,EACNC,MAAOA"} -------------------------------------------------------------------------------- /public/assets/js/now-ui-dashboard.min.js: -------------------------------------------------------------------------------- 1 | !function(){if(isWindows=-1',$(div).appendTo("body").click(function(){$("html").removeClass("nav-open"),nowuiDashboard.misc.navbar_menu_visible=0,setTimeout(function(){$toggle.removeClass("toggled"),$("#bodyClick").remove()},550)}),$("html").addClass("nav-open"),nowuiDashboard.misc.navbar_menu_visible=1)}),$(window).resize(function(){seq=seq2=0,0==$(".full-screen-map").length&&0==$(".bd-docs").length&&($navbar=$(".navbar"),isExpanded=$(".navbar").find('[data-toggle="collapse"]').attr("aria-expanded"),$navbar.hasClass("bg-white")&&991<$(window).width()?0==scrollElement.scrollTop()&&$navbar.removeClass("bg-white").addClass("navbar-transparent"):$navbar.hasClass("navbar-transparent")&&$(window).width()<991&&"false"!=isExpanded&&$navbar.addClass("bg-white").removeClass("navbar-transparent")),is_iPad&&$("body").removeClass("sidebar-mini")}),nowuiDashboard={misc:{navbar_menu_visible:0},showNotification:function(a,e){color="primary",$.notify({icon:"now-ui-icons ui-1_bell-53",message:"Welcome to Now Ui Dashboard - a beautiful freebie for every web developer."},{type:color,timer:8e3,placement:{from:a,align:e}})}}; -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cinderjk/zete/daa40f4e339006407d30ccdc739dd3d245d70041/public/favicon.ico -------------------------------------------------------------------------------- /public/index.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class); 50 | 51 | $response = $kernel->handle( 52 | $request = Request::capture() 53 | )->send(); 54 | 55 | $kernel->terminate($request, $response); 56 | -------------------------------------------------------------------------------- /public/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /public/template_contact.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cinderjk/zete/daa40f4e339006407d30ccdc739dd3d245d70041/public/template_contact.xlsx -------------------------------------------------------------------------------- /resources/css/app.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cinderjk/zete/daa40f4e339006407d30ccdc739dd3d245d70041/resources/css/app.css -------------------------------------------------------------------------------- /resources/js/app.js: -------------------------------------------------------------------------------- 1 | import {livewire_hot_reload} from 'virtual:livewire-hot-reload' 2 | 3 | livewire_hot_reload(); -------------------------------------------------------------------------------- /resources/js/bootstrap.js: -------------------------------------------------------------------------------- 1 | import _ from 'lodash'; 2 | window._ = _; 3 | 4 | /** 5 | * We'll load the axios HTTP library which allows us to easily issue requests 6 | * to our Laravel back-end. This library automatically handles sending the 7 | * CSRF token as a header based on the value of the "XSRF" token cookie. 8 | */ 9 | 10 | import axios from 'axios'; 11 | window.axios = axios; 12 | 13 | window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 14 | 15 | /** 16 | * Echo exposes an expressive API for subscribing to channels and listening 17 | * for events that are broadcast by Laravel. Echo and event broadcasting 18 | * allows your team to easily build robust real-time web applications. 19 | */ 20 | 21 | // import Echo from 'laravel-echo'; 22 | 23 | // import Pusher from 'pusher-js'; 24 | // window.Pusher = Pusher; 25 | 26 | // window.Echo = new Echo({ 27 | // broadcaster: 'pusher', 28 | // key: import.meta.env.VITE_PUSHER_APP_KEY, 29 | // wsHost: import.meta.env.VITE_PUSHER_HOST ? import.meta.env.VITE_PUSHER_HOST : `ws-${import.meta.env.VITE_PUSHER_APP_CLUSTER}.pusher.com`, 30 | // wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80, 31 | // wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443, 32 | // forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https', 33 | // enabledTransports: ['ws', 'wss'], 34 | // }); 35 | -------------------------------------------------------------------------------- /resources/views/layouts/app.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | {{ config('app.name') }} 11 | 12 | 14 | 15 | 17 | 18 | 19 | @livewireStyles() 20 | {{-- @if(config('app.env') == 'local') 21 | @vite('resources/js/app.js') 22 | @endif --}} 23 | 24 | 25 | 26 |
27 | 35 |
36 | @livewire('part.navbar') 37 |
38 |
39 |
40 | {{ $slot }} 41 |
42 | @livewire('part.footer') 43 |
44 |
45 | 46 | 47 | 48 | 49 | 50 | 51 | 64 | @if (session()->has('message')) 65 | 74 | @endif 75 | @stack('scripts') 76 | @livewireScripts() 77 | 78 | 79 | -------------------------------------------------------------------------------- /resources/views/layouts/auth.blade.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | {{ config('app.name') }} 11 | 12 | 14 | 15 | 17 | 18 | 19 | @livewireStyles() 20 | @if(config('app.env') == 'local') 21 | @vite('resources/js/app.js') 22 | @endif 23 | 24 | 25 | 26 | {{ $slot }} 27 | 28 | 29 | 30 | 31 | 32 | 33 | 46 | @if (session()->has('message')) 47 | 56 | @endif 57 | @stack('scripts') 58 | @livewireScripts() 59 | 60 | 61 | -------------------------------------------------------------------------------- /resources/views/livewire/auth/login.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | 29 |
30 |
31 |
32 |
-------------------------------------------------------------------------------- /resources/views/livewire/auth/logout.blade.php: -------------------------------------------------------------------------------- 1 |
2 | Log out 3 |
-------------------------------------------------------------------------------- /resources/views/livewire/docs.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 |

Documentation API

7 |
8 |
9 |
10 |
11 |
12 |
API KEY
13 |
14 |
15 | 17 |
18 |
19 |
20 | 21 |
22 | 54 |
55 |
56 | @livewire('docs.send-message') 57 |
58 | {{--
59 | @livewire('docs.chat-list') 60 |
61 |
62 | @livewire('docs.chat-conversation') 63 |
64 |
65 | @livewire('docs.group-list') 66 |
67 |
68 | @livewire('docs.group-conversation') 69 |
70 |
71 | @livewire('docs.group-info') 72 |
--}} 73 |
74 |
75 |
76 |
77 | @push('scripts') 78 | 86 | @endpush 87 |
-------------------------------------------------------------------------------- /resources/views/livewire/docs/chat-conversation.blade.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 | 24 | 31 | 32 | 33 | 34 | 41 | 42 | 43 | 44 | 62 | 63 | 64 |
MethodPOST
URL{{ config('app.url') }}/api/chats/conversation
Format DataJSON
Header 19 | Authorization: Bearer [api_key] 20 |
Body 25 |
{
26 |
  "device_id": "xx",
27 |
  "phone": "62822xxxxxxx",
28 |
  "limit" : 25,
29 |
}
30 |
Response 35 |
{
36 |
  "success": true,
37 |
  "message" : "",
38 |
  "data": []
39 |
}
40 |
Example PHP 45 |
$url = '{{ config('app.url') }}/api/chats/conversation';
46 |
$data = '{"device_id": "xx", "phone" : "62822xxxxxxx", "limit" : 25}';
47 |
$authorization = "Authorization: Bearer [api_key]";
48 | 49 |
$ch = curl_init($url);
50 |
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
51 |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
52 |
curl_setopt($ch, CURLOPT_POST, 1);
53 |
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
54 |
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json' , $authorization));
56 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
57 |
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
58 |
$result = curl_exec($ch);
59 |
curl_close($ch);
60 |
print_r ($result);
61 |
65 |
-------------------------------------------------------------------------------- /resources/views/livewire/docs/chat-list.blade.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 40 | 41 | 42 | 43 | 62 | 63 | 64 |
MethodPOST
URL{{ config('app.url') }}/api/chats
Format DataJSON
Header 19 | Authorization: Bearer [api_key] 20 |
Body 25 |
{
26 |
  "device_id": "xx",
27 |
  "limit" : 25,
28 |
}
29 |
Response 34 |
{
35 |
  "success": true,
36 |
  "message" : "",
37 |
  "data": []
38 |
}
39 |
Example PHP 44 |
$url = '{{ config('app.url') }}/api/chats';
45 |
$data = '{"device_id": "xx"}';
47 |
$authorization = "Authorization: Bearer [api_key]";
48 | 49 |
$ch = curl_init($url);
50 |
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
51 |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
52 |
curl_setopt($ch, CURLOPT_POST, 1);
53 |
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
54 |
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json' , $authorization));
56 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
57 |
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
58 |
$result = curl_exec($ch);
59 |
curl_close($ch);
60 |
print_r ($result);
61 |
65 |
-------------------------------------------------------------------------------- /resources/views/livewire/docs/group-conversation.blade.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 | 24 | 31 | 32 | 33 | 34 | 41 | 42 | 43 | 44 | 62 | 63 | 64 |
MethodPOST
URL{{ config('app.url') }}/api/groups/conversation
Format DataJSON
Header 19 | Authorization: Bearer [api_key] 20 |
Body 25 |
{
26 |
  "device_id": "xx",
27 |
  "group_id": "xx",
28 |
  "limit" : 25,
29 |
}
30 |
Response 35 |
{
36 |
  "success": true,
37 |
  "message" : "",
38 |
  "data": []
39 |
}
40 |
Example PHP 45 |
$url = '{{ config('app.url') }}/api/groups/conversation';
46 |
$data = '{"device_id": "xx", "group_id" : "xx", "limit" : 25}';
47 |
$authorization = "Authorization: Bearer [api_key]";
48 | 49 |
$ch = curl_init($url);
50 |
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
51 |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
52 |
curl_setopt($ch, CURLOPT_POST, 1);
53 |
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
54 |
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json' , $authorization));
56 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
57 |
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
58 |
$result = curl_exec($ch);
59 |
curl_close($ch);
60 |
print_r ($result);
61 |
65 |
-------------------------------------------------------------------------------- /resources/views/livewire/docs/group-info.blade.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 40 | 41 | 42 | 43 | 61 | 62 | 63 |
MethodPOST
URL{{ config('app.url') }}/api/groups/info
Format DataJSON
Header 19 | Authorization: Bearer [api_key] 20 |
Body 25 |
{
26 |
  "device_id": "xx",
27 |
  "group_id" : "xx",
28 |
}
29 |
Response 34 |
{
35 |
  "success": true,
36 |
  "message" : "",
37 |
  "data": []
38 |
}
39 |
Example PHP 44 |
$url = '{{ config('app.url') }}/api/groups/info';
45 |
$data = '{"device_id": "xx", "group_id" : "xx"}';
46 |
$authorization = "Authorization: Bearer [api_key]";
47 | 48 |
$ch = curl_init($url);
49 |
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
50 |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
51 |
curl_setopt($ch, CURLOPT_POST, 1);
52 |
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
53 |
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json' , $authorization));
55 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
56 |
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
57 |
$result = curl_exec($ch);
58 |
curl_close($ch);
59 |
print_r ($result);
60 |
64 |
-------------------------------------------------------------------------------- /resources/views/livewire/docs/group-list.blade.php: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 23 | 24 | 30 | 31 | 32 | 33 | 40 | 41 | 42 | 43 | 62 | 63 | 64 |
MethodPOST
URL{{ config('app.url') }}/api/groups
Format DataJSON
Header 19 | Authorization: Bearer [api_key] 20 |
Body 25 |
{
26 |
  "device_id": "xx",
27 |
  "limit" : 25,
28 |
}
29 |
Response 34 |
{
35 |
  "success": true,
36 |
  "message" : "",
37 |
  "data": []
38 |
}
39 |
Example PHP 44 |
$url = '{{ config('app.url') }}/api/groups';
45 |
$data = '{"device_id": "xx"}';
47 |
$authorization = "Authorization: Bearer [api_key]";
48 | 49 |
$ch = curl_init($url);
50 |
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
51 |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
52 |
curl_setopt($ch, CURLOPT_POST, 1);
53 |
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
54 |
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json' , $authorization));
56 |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
57 |
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
58 |
$result = curl_exec($ch);
59 |
curl_close($ch);
60 |
print_r ($result);
61 |
65 |
-------------------------------------------------------------------------------- /resources/views/livewire/part/footer.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 | 13 | 22 |
23 |
-------------------------------------------------------------------------------- /resources/views/livewire/part/navbar.blade.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/views/livewire/part/sidebar.blade.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /resources/views/livewire/user/add-device.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |

Add Device

6 |
7 |
8 |
9 |
10 | 11 | 12 |
13 |
14 | 15 | 17 |
18 |
19 | 20 | 24 |
25 |
26 | 27 | Back 28 |
29 |
30 |
31 |
32 |
33 |
-------------------------------------------------------------------------------- /resources/views/livewire/user/add-message.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |

Add Message

6 |
7 |
8 |
9 |
10 | 11 | 18 | @error('device_id')

{{ $message }}

@enderror 19 |
20 |
21 | 22 | 24 | @error('to')

{{ $message }}

@enderror 25 |
26 |
27 |
28 |
29 | 30 | 32 | @error('message')

{{ $message }}

@enderror 33 |
34 |
35 | 38 |
39 |

Random...

40 |
41 |
42 |
43 |
44 |
45 | 46 | Back 47 |
48 |
49 |

Sending message...

50 |
51 |
52 | @if(config('app.use_job_queue')) 53 |
54 |

Message will be sent using job queue. Docs

56 |
57 | @endif 58 |
59 |
60 |
61 |
-------------------------------------------------------------------------------- /resources/views/livewire/user/change-password.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |

Change Password

6 |
7 |
8 |
9 |
10 | 11 | 13 | @error('current_password') 14 | {{ $message }} 15 | @enderror 16 |
17 |
18 | 19 | 21 | @error('password') 22 | {{ $message }} 23 | @enderror 24 |
25 |
26 | 27 | 29 | @error('password_confirmation') 30 | {{ $message }} 31 | @enderror 32 |
33 |
34 | 35 |
36 |
37 |
38 |
39 |
40 | {{-- @push('scripts') 41 | 42 | @endpush --}} 43 |
-------------------------------------------------------------------------------- /resources/views/livewire/user/dashboard.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 |
7 |
Devices
8 |
9 |
10 |

{{ $devices }}

11 |
12 |
13 |
14 |
15 |
16 |
17 |
Connected Devices
18 |
19 |
20 |

{{ $connected_devices }}

21 |
22 |
23 |
24 |
25 |
26 |
27 |
Disonnected
28 |
29 |
30 |

{{ $disconnected_devices }}

31 |
32 |
33 |
34 |
35 |
36 |
-------------------------------------------------------------------------------- /resources/views/livewire/user/device.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 |

Devices

7 | Add 8 |
9 | 10 |
11 |
12 |
13 | 14 | 15 | 16 | 19 | 22 | 25 | 28 | 31 | 32 | 33 | 34 | @forelse ($devices as $item) 35 | 36 | 39 | 42 | 45 | 52 | 72 | 73 | @empty 74 | 75 | 78 | 79 | @endforelse 80 | 81 | 85 | 86 | 87 |
17 | Device ID 18 | 20 | Name 21 | 23 | Description 24 | 26 | Status 27 | 29 | Actions 30 |
37 | {{ $item->id }} 38 | 40 | {{ $item->name }} 41 | 43 | {{ $item->description }} 44 | 46 | @if ($item->status == 1) 47 | Connected 48 | @else 49 | Disconnected 50 | @endif 51 | 53 | 54 | 55 | 56 | @if ($item->status == 1) 57 | 61 | @else 62 | 64 | 65 | 66 | @endif 67 | 71 |
76 | No devices, please add a device. 77 |
82 | 84 |
88 |
89 |
90 |
91 |
92 |
93 |
-------------------------------------------------------------------------------- /resources/views/livewire/user/edit-contact.blade.php: -------------------------------------------------------------------------------- 1 |
2 | {{-- Do your work, then step back. --}} 3 |
4 | -------------------------------------------------------------------------------- /resources/views/livewire/user/edit-device.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |

Edit Device

6 |
7 |
8 |
9 |
10 | 11 | 12 |
13 |
14 | 15 | 17 |
18 |
19 | 20 | 24 |
25 |
26 | 27 | Back 28 |
29 |
30 |
31 |
32 |
33 |
-------------------------------------------------------------------------------- /resources/views/livewire/user/group.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 |

Groups

7 |
8 | Add 9 |
10 |
11 |
12 |
13 |
14 | 15 |
16 |
17 | 18 |
19 |
20 |
21 |
22 |
23 | 29 |
30 |
31 |
32 |
33 |
34 | 35 | 36 | 37 | 40 | 43 | 44 | 45 | 46 | @forelse ($groups as $item) 47 | 48 | 51 | 61 | 62 | 63 | @empty 64 | 65 | 68 | 69 | @endforelse 70 | 71 | 78 | 79 | 80 |
38 | Name 39 | 41 | Action 42 |
49 | {{ $item->name }} 50 | 52 | 54 | 55 | 56 | 60 |
66 | Empty groups :( 67 |
72 | 77 |
81 |
82 | {{ $groups->links() }} 83 |
84 |
85 |
86 | @push('scripts') 87 | 94 | @endpush 95 |
-------------------------------------------------------------------------------- /resources/views/livewire/user/message.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |
6 |

Messages

7 |
8 | Add 9 | 13 |
14 |
15 | 16 |
17 |
18 |
19 | 20 | 21 | 22 | 25 | 28 | 31 | 34 | 37 | 38 | 39 | 40 | @forelse ($message_logs as $item) 41 | 42 | 45 | 48 | 51 | 58 | 61 | 62 | @empty 63 | 64 | 67 | 68 | @endforelse 69 | 70 | 77 | 78 | 79 |
23 | Name 24 | 26 | To 27 | 29 | Message 30 | 32 | Status 33 | 35 | Time 36 |
43 | {{ $item->device_name }} 44 | 46 | {{ $item->to }} 47 | 49 | {{ $item->message }} 50 | 52 | @if ($item->status == 200) 53 | OK 54 | @else 55 | ERROR 56 | @endif 57 | 59 | {{ $item->created_at }} 60 |
65 | Empty log messages :) 66 |
71 | 76 |
80 |
81 | {{ $message_logs->links() }} 82 |
83 |
84 |
85 |
-------------------------------------------------------------------------------- /resources/views/livewire/user/modal/import-contact.blade.php: -------------------------------------------------------------------------------- 1 |
2 | {{-- The Master doesn't talk, he acts. --}} 3 |
4 | -------------------------------------------------------------------------------- /resources/views/livewire/user/profile.blade.php: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 |

Profile

6 |
7 |
8 |
9 |
10 | 11 | 12 |
13 |
14 | 15 | 17 |
18 |
19 | 20 | 22 |
23 |
24 |
25 |
26 |
27 | {{-- @push('scripts') 28 | 29 | @endpush --}} 30 |
-------------------------------------------------------------------------------- /resources/views/vendor/livewire/bootstrap.blade.php: -------------------------------------------------------------------------------- 1 |
2 | @if ($paginator->hasPages()) 3 | @php(isset($this->numberOfPaginatorsRendered[$paginator->getPageName()]) ? $this->numberOfPaginatorsRendered[$paginator->getPageName()]++ : $this->numberOfPaginatorsRendered[$paginator->getPageName()] = 1) 4 | 5 | 49 | @endif 50 |
51 | -------------------------------------------------------------------------------- /resources/views/vendor/livewire/simple-bootstrap.blade.php: -------------------------------------------------------------------------------- 1 |
2 | @if ($paginator->hasPages()) 3 | 40 | @endif 41 |
42 | -------------------------------------------------------------------------------- /resources/views/vendor/livewire/simple-tailwind.blade.php: -------------------------------------------------------------------------------- 1 |
2 | @if ($paginator->hasPages()) 3 | 42 | @endif 43 |
44 | -------------------------------------------------------------------------------- /routes/api.php: -------------------------------------------------------------------------------- 1 | group(function () { 11 | Route::prefix('session')->group(function () { 12 | Route::get('status', [SessionController::class, 'status']); 13 | Route::post('create', [SessionController::class, 'create']); 14 | Route::post('close', [SessionController::class, 'close']); 15 | }); 16 | 17 | Route::prefix('messages')->group(function () { 18 | Route::get('/', [MessageController::class, 'list']); 19 | Route::post('send', [MessageController::class, 'send']); 20 | }); 21 | 22 | Route::prefix('contacts')->group(function () { 23 | Route::get('/', [ContactController::class, 'list']); 24 | Route::get('check', [ContactController::class, 'checkNumber']); 25 | Route::post('block', [ContactController::class, 'blockContact']); 26 | }); 27 | }); 28 | -------------------------------------------------------------------------------- /routes/channels.php: -------------------------------------------------------------------------------- 1 | id === (int) $id; 18 | }); 19 | -------------------------------------------------------------------------------- /routes/console.php: -------------------------------------------------------------------------------- 1 | comment(Inspiring::quote()); 19 | })->purpose('Display an inspiring quote'); 20 | -------------------------------------------------------------------------------- /routes/web.php: -------------------------------------------------------------------------------- 1 | name('login'); 40 | 41 | // middleware('auth') is required to access the dashboard 42 | Route::middleware(['auth'])->group(function () { 43 | Route::get('dashboard', UserDashboard::class)->name('dashboard'); 44 | Route::get('devices', UserDevice::class)->name('device'); 45 | Route::get('add-device', UserAddDevice::class)->name('add-device'); 46 | Route::get('edit-device/{id}', UserEditDevice::class)->name('edit-device'); 47 | Route::get('scan-device/{id}', UserScanDevice::class)->name('scan-device'); 48 | 49 | Route::get('messages', UserMessage::class)->name('message'); 50 | Route::get('add-message', UserAddMessage::class)->name('add-message'); 51 | 52 | Route::group(['prefix' => 'contact'], function () { 53 | Route::get('/', UserContact::class)->name('contact'); 54 | Route::get('add', UserAddContact::class)->name('add-contact'); 55 | Route::get('edit/{id}', UserEditContact::class)->name('edit-contact'); 56 | Route::get('group', UserGroup::class)->name('group'); 57 | }); 58 | 59 | Route::post('import-contact', [ExcelController::class, 'importContact'])->name('import-contact'); 60 | 61 | Route::get('docs', Docs::class)->name('docs'); 62 | Route::get('profile', UserProfile::class)->name('profile'); 63 | Route::get('change-password', UserChangePassword::class)->name('change-password'); 64 | }); 65 | -------------------------------------------------------------------------------- /storage/app/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !public/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/app/public/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/.gitignore: -------------------------------------------------------------------------------- 1 | compiled.php 2 | config.php 3 | down 4 | events.scanned.php 5 | maintenance.php 6 | routes.php 7 | routes.scanned.php 8 | schedule-* 9 | services.json 10 | -------------------------------------------------------------------------------- /storage/framework/cache/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !data/ 3 | !.gitignore 4 | -------------------------------------------------------------------------------- /storage/framework/cache/data/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/sessions/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/testing/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/framework/views/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /storage/logs/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore 3 | -------------------------------------------------------------------------------- /tests/CreatesApplication.php: -------------------------------------------------------------------------------- 1 | make(Kernel::class)->bootstrap(); 19 | 20 | return $app; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /tests/Feature/ExampleTest.php: -------------------------------------------------------------------------------- 1 | get('/'); 18 | 19 | $response->assertStatus(200); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /tests/TestCase.php: -------------------------------------------------------------------------------- 1 | assertTrue(true); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /vite.config.js: -------------------------------------------------------------------------------- 1 | import {defineConfig} from 'vite'; 2 | import laravel from 'laravel-vite-plugin'; 3 | 4 | import livewire from '@defstudio/vite-livewire-plugin'; // Here we import it 5 | 6 | export default defineConfig({ 7 | plugins: [ 8 | laravel([ 9 | 'resources/css/app.css', 10 | 'resources/js/app.js', 11 | ]), 12 | 13 | livewire({ // Here we add it to the plugins 14 | refresh: ['resources/css/app.css'], 15 | }), 16 | ], 17 | }); --------------------------------------------------------------------------------