TomatoPHP
Join CommunityGitHubDiscord
  • 🚀Overview
  • 🏅Support
  • 🤝Contributing
  • 🛣️Screenshots
  • Get Started
    • 🔥Environment Setup
      • 💿Configuring the server
      • 📡Install Valet
      • 🎟️Install PHPMyAdmin
    • 🚀Install
    • ✨Start Your First CRUD
  • Tomato Admin
    • 🚀Get Started
    • 🧠Install
    • 🛗Generate CRUD
    • 👓Slots
    • 🌉Widgets
    • 📖Menus
    • 🔁Requests
      • 🔁Index Request
      • 🔁JSON Request
      • 🔁Get Request
      • 🔁Store Request
      • 🔁Update Request
      • 🔁Destroy Request
    • 🎹Inputs
      • 🔆Rich Text Editor
      • 📞Phone Editor
      • 🖌️Color Switcher
      • 🔁Inputs Repeater
      • 💧Draggable
      • 👨‍💻Code Editor
      • ⚡Select Input
      • 🔚Submit
      • 🧾Items
      • 🔍Search
      • 🚁Icon
    • 🗜️Components
      • 🔗Relation Manager
      • 🧊Container
      • 👁️View Row
      • 🌉Widget
      • 🔘Button
      • 📖Menu
      • 👾Tooltip
      • ©️©️ Clipboard
      • 🛣️Slider
      • ℹ️Action Buttons
      • 🍅Application Logo
      • 🔽Dropdown
      • ⏸️Paginator
    • 📑Table
      • ✅Bulk Actions
      • 🗄️Filters
      • 🦘Slots
    • 🔓Jetstream & Fortify
    • 🆕Upgrade
  • Tomato PHP
    • 🚀Get Started
    • 🎹Use
  • Plugins
    • 🔌Get Started
    • 🏗️Create New Plugin
    • 🔓Tomato Roles
      • 📐Use
      • 🔏Developer Gate
      • 🏗️Register Permission
      • 💽Config
    • 🌎Tomato Locations
      • 🔁APIs
    • ⚙️Tomato Settings
      • 📐Use
      • 💽Config
    • 🔔Tomato Notifications
      • 📐Use
      • 🏗️Notification Service
      • 💽Config
      • 🔁APIs
    • 🔷Tomato Category
      • 📐Use
      • 💽Config
      • 🔁APIs
    • ✨Tomato Forms
      • 📐Use
      • 💽Config
      • 🔁APIs
    • 📖Tomato Menus
      • 📐Use
      • 💽Config
    • 👨‍💼Tomato CRM
      • 📐Use
      • 🏗️Auth Builder
      • 🔥Events
      • 💽Config
      • 🔁APIs
    • 💳Tomato Wallet
      • 📐Use
      • 🗂️Payment Methods
      • 💽Config
      • 🔁APIs
    • 📃Tomato CMS
      • 📐Use
      • 💽Config
    • 🎧Tomato Support
      • 📐Use
      • 💽Config
      • 🔁APIs
    • 👜Tomato Products
      • 💿Config
      • 🌆Screenshots
    • 💯Tomato Coupons
      • 💿Config
      • 🌆Screenshots
    • 🚀Tomato Orders
      • 💿Config
      • 🌆Screenshots
    • 🛍️Tomato Ecommerce
      • 🎭Install E-commerce Theme
      • 💿Config
      • 🌆Screenshots
    • 🚛Tomato Inventory
      • 💿Config
    • 🧾Tomato POS
      • 💿Config
    • 📄Tomato Invoices
      • 💿Config
    • 🏬Tomato Subscription
      • 📐Use
      • 💽Config
    • 🧪Tomato Dusk
      • 📐Use
      • 💿Config
      • 🌆Screenshots
    • ⚔️Tomato Chat
      • 🏗️Setup
      • 📐Use
      • 💽Config
    • 📱Tomato Flutter
      • 📐Use
      • 🧲Generate CRUD
      • 🚀Change Endpoint
      • ⏩Tomato Froms
      • 🛣️Screenshots
    • 🏗️Tomato Builder
      • 🧠Install
      • 🖍️Use
      • 🌆Screenshots
      • 💿Config
    • 🏗️Tomato Sections
      • 💿Config
    • 🎭Tomato Themes
      • 🏂Create New Theme
      • 🏗️Theme Builder
      • 🛍️Install E-commerce Theme
      • 💿Config
    • 📠Tomato Eddy
      • 💿Config
    • 👨‍💻Tomato User Activities
      • 💿Config
    • 👨‍💼Tomato PMS
    • ✅Tomato Tasks
    • ⌛Tomato Timer
    • ✈️Tomato API
    • 🚦Tomato Figma
    • 🌟Tomato SaaS
    • 🔤Tomato Translations
    • 👨‍💻Tomato Artisan
    • 🎒Tomato Backup
    • 📂Tomato Browser
    • 📕Tomato Logs
  • Helpers
    • 🍕Laravel Console Helpers
    • 📽️Laravel Agora
    • 💿Laravel Package Generator
  • Filament
    • 🌎Try Plugins
    • 👨‍🏭Filament Users
      • 🛣️Screenshots
      • 🏗️Installation
      • 🛡️Integration
      • 💼Use Facade Class
      • 📢Publish Assets
    • 🌎Filament Translations
      • 🛣️Screenshots
      • 🏗️Installation
      • 🇪🇬Language Switcher
      • 👨‍💻Command Line
      • 🔧Queue
      • 🔘Buttons
      • 🤖AI Integration
      • 🌠Import & Export
      • 📢Publish Assets
    • ⚙️Filament Settings Hub
      • 🛣️Screenshots
      • 🏗️Installation
      • ▶️Usage
      • 📢Publish Assets
    • 🍔Filament Menus
      • 🏗️Installation
      • 🛣️Screenshots
      • ⏩Use as Filament Navigation
      • ⏯️Use as a Livewire Component
      • 📢Publish Assets
    • 🆎Filament Types
      • 🛣️Screenshots
      • 🏗️Installation
      • ⏯️Register New Type
      • 🎹Use Type Helper
      • 🔄Use Type Column
      • 📢Publish Assets
    • 🔌Filament Plugins
      • 🛣️Screenshots
      • 🏗️Installation
      • ⏯️Usage
      • ®️®️ List your package on the plugins list
      • 📶Use Selected Module in your panel
      • 🏂Get Only Current Panel Plugins
      • 🛑Stop Auto Discover Module Resources
      • 🎸Stop Using Plugins UI
      • 📢Publish Assets
    • 🦄Filament Icons
      • 🛣️Screenshots
      • 🏗️Installation
      • ⏯️Usage
      • 🪄Add Custom Icons
      • 📢Publish Assets
    • 🗺️Filament Locations
      • 🛣️Screenshots
      • 🏗️Installation
      • 📢Publish Assets
    • 📢Filament Alerts
      • 🛣️Screenshots
      • 🏗️Installation
      • ⏯️Usage
      • 🔥Firebase Integration
      • 🔗Slack Integration
      • 🔗Discord Integration
      • ⚙️API
      • 📢Publish Assets
    • 🦸‍♂️Filament Accounts
      • 🛣️Screenshots
      • 🏗️Installation
      • ⏯️Usage
      • 🎇Use Accounts as SaaS Panel
      • 🍫Use Account Column
      • 🔔Use Notifications
      • 🗺️Use Account Locations
      • 🅰️Use Filament Types
      • 🔏Use Filament Impersonate
      • 🏢How to use a builder
      • ✌️Custom validation
      • 🆕Attach New Field
      • 🎌Attach Relation
      • 🔘Attach Table Button
      • 🛁Auth Events
      • ⚙️APIs
    • 💰Filament Wallet
      • 🛣️Screenshots
      • 🏗️Installation
      • ⏯️Usage
      • 🏁Filament Accounts Integration
      • 📢Publish Assets
    • ✨Filament Splade
      • 🛣️Screenshots
      • 🏗️Installation
      • ⏯️Usage
      • 📢Publish Assets
    • 🔐Filament Developer Gate
      • 🛣️Screenshots
      • 🏗️Installation
      • ⏯️Usage
      • 📢Publish Assets
    • 🏛️Filament Helpers
      • 🏗️Installation
      • ⏯️Using
    • 👨‍💻Filament Artisan
      • 🛣️Screenshots
      • 🏗️Installation
      • 🏃‍♂️Running command
      • ⚙️Configuration
      • 📢Publish Assets
    • 📂Filament Browser
      • 🛣️Screenshots
      • 🏗️Installation
      • 📢Publish Assets
    • 🔥Filament FCM
      • 🏗️Installation
      • ⏯️Usage
      • 📢Publish Assets
    • 🖊️Filament CMS
      • 🛣️Screenshots
      • 🏗️Installation
      • ⏯️Custom Type
      • ⏯️Custom Author Type
      • 📺Youtube Integration
      • 🏩Behance Integration
      • 🎭Theme Manager
      • 🏨Page Builder
      • 🔡Form Builder
      • 📢Publish Assets
    • 🔗Filament API
      • 🛣️Screenshots
      • 🏗️Installation
      • ⏯️Usage
      • 📢Publish Assets
    • 👜Filament Ecommerce
      • 🛣️Screenshots
      • 🏗️Installation
      • 🎁Use Coupon Service
      • 📢Publish Assets
    • 🔚Filament Twilio
      • 🏗️Installation
      • ⏯️Using
      • 📢Publish Assets
    • ⚔️Filament Discord
      • 🛣️Screenshot
      • 🏗️Installation
      • ⏯️Using
      • 🦸‍♂️Send to Selected User
      • ⚡Allow Discord Error Logger
      • 📢Publish Assets
    • 🆎Filament Translation Component
      • 🛣️Screenshot
      • 🏗️Installation
      • ⏯️Using
      • 📢Publish Assets
    • 📒Filament Notes
      • 🛣️Screenshot
      • 🏗️Installation
      • ⏯️Using
      • 📢Publish Assets
    • 📼Filament Media Manager
      • 🛣️Screenshots
      • 🏗️Installation
      • ⏯️Use Component
      • 🅰️Add Custom Type
      • 📂Allow Sub Folders
      • 🦸‍♂️Allow User Access
      • 🎇Folders API
      • 📢Publish Assets
    • 💳Filament Withdrawals
      • 🛣️Screenshots
      • 🏗️Installation
      • ⏯️Custom Author Type
      • 🔡Form Builder
      • 📢Publish Assets
    • 🧾Filament POS
      • 🌄Screenshots
      • 🏗️Installation
      • 📢Publish Assets
  • Learn
    • 🛍️Build E-Commerce
    • 🙏Task To Get Start
    • 🔴Use Github
    • 🔥Deploy Laravel App Using GitHub Actions
      • 🏯Install Cloudpanel
      • 🔓Link Cloudflare
      • 🔃Clone Repo
      • 🎇Workflow
      • 🦕Deploy Script
    • 🦄Awesome TailwindCSS
    • 💻Terminal
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. Plugins
  2. Tomato CRM

APIs

you can show the APIs Endpoints here

you can activate this feature or stop it from the config file and use your own routes or your own controllers.

to make this endpoint work fine you need to add a custom gruid inside /config/auth.php to be like this

<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Authentication Defaults
    |--------------------------------------------------------------------------
    |
    | This option controls the default authentication "guard" and password
    | reset options for your application. You may change these defaults
    | as required, but they're a perfect start for most applications.
    |
    */

    'defaults' => [
        'guard' => 'web',
        'passwords' => 'users',
    ],

    /*
    |--------------------------------------------------------------------------
    | Authentication Guards
    |--------------------------------------------------------------------------
    |
    | Next, you may define every authentication guard for your application.
    | Of course, a great default configuration has been defined for you
    | here which uses session storage and the Eloquent user provider.
    |
    | All authentication drivers have a user provider. This defines how the
    | users are actually retrieved out of your database or other storage
    | mechanisms used by this application to persist your user's data.
    |
    | Supported: "session"
    |
    */

    'guards' => [
        'web' => [
            'driver' => 'session',
            'provider' => 'users',
        ],
        'accounts' => [
            'driver' => 'session',
            'provider' => 'accounts',
        ]
    ],

    /*
    |--------------------------------------------------------------------------
    | User Providers
    |--------------------------------------------------------------------------
    |
    | All authentication drivers have a user provider. This defines how the
    | users are actually retrieved out of your database or other storage
    | mechanisms used by this application to persist your user's data.
    |
    | If you have multiple user tables or models you may configure multiple
    | sources which represent each model / table. These sources may then
    | be assigned to any extra authentication guards you have defined.
    |
    | Supported: "database", "eloquent"
    |
    */

    'providers' => [
        'users' => [
            'driver' => 'eloquent',
            'model' => App\Models\User::class,
        ],
        'accounts' => [
            'driver' => 'eloquent',
            'model' => \TomatoPHP\TomatoCrm\Models\Account::class,
        ],

        // 'users' => [
        //     'driver' => 'database',
        //     'table' => 'users',
        // ],
    ],

    /*
    |--------------------------------------------------------------------------
    | Resetting Passwords
    |--------------------------------------------------------------------------
    |
    | You may specify multiple password reset configurations if you have more
    | than one user table or model in the application and you want to have
    | separate password reset settings based on the specific user types.
    |
    | The expiry time is the number of minutes that each reset token will be
    | considered valid. This security feature keeps tokens short-lived so
    | they have less time to be guessed. You may change this as needed.
    |
    | The throttle setting is the number of seconds a user must wait before
    | generating more password reset tokens. This prevents the user from
    | quickly generating a very large amount of password reset tokens.
    |
    */

    'passwords' => [
        'users' => [
            'provider' => 'users',
            'table' => 'password_reset_tokens',
            'expire' => 60,
            'throttle' => 60,
        ],
    ],

    /*
    |--------------------------------------------------------------------------
    | Password Confirmation Timeout
    |--------------------------------------------------------------------------
    |
    | Here you may define the amount of seconds before a password confirmation
    | times out and the user is prompted to re-enter their password via the
    | confirmation screen. By default, the timeout lasts for three hours.
    |
    */

    'password_timeout' => 10800,

];

Auth Endpoints

Profile Endpoints

PreviousConfigNextTomato Wallet

Last updated 1 year ago

Was this helpful?

👨‍💼
🔁

User Profile

get

You Can Return user resource data from this APIs.

Responses
200
A user resource with Token.
application/json
404
Sorry User Not Found!.
application/json
get
GET /api/profile HTTP/1.1
Host: cm.test
Accept: */*
{
  "status": true,
  "message": "Profile Data Load",
  "data": {}
}

Update User Profile

post

You can update user data by use this APIs.⚠️Cannot generate request documentation: Undefined variable $user

Responses
200
A user resource with Token.
application/json
404
Sorry User Not Found!.
application/json
422
Validation error
application/json
post
POST /api/profile HTTP/1.1
Host: cm.test
Accept: */*
{
  "status": true,
  "message": "Profile Data Update",
  "data": {}
}
  • Auth Endpoints
  • POSTLogin
  • POSTRegister
  • POSTReset Password
  • POSTResend OTP
  • POSTCheck OTP & Active Account
  • POSTCheck OTP
  • POSTChange Password
  • Profile Endpoints
  • GETUser Profile
  • POSTUpdate User Profile
  • POSTUpdate User Password
  • DELETEClose Account
  • POSTLogout User

Login

post

We are using bearer token auth system and you can get token by using this APIs.

Body
emailstringRequired
passwordstringRequired
Responses
200
A user resource with Token.
application/json
400
If User Not Found or Password Is Not Correct
application/json
401
A user resource.
application/json
422
Validation error
application/json
post
POST /api/login HTTP/1.1
Host: cm.test
Content-Type: application/json
Accept: */*
Content-Length: 34

{
  "email": "text",
  "password": "text"
}
{
  "status": true,
  "message": "Data Retrieved Successfully",
  "data": {
    "token": "text"
  }
}

Register

post

You can create a new account by use this API.

Body
namestringRequired
phonestringRequired
emailstring · emailRequired
passwordstringRequired
front_idstring · binaryRequired
back_idstring · binaryRequired
relation_typeinteger | nullOptional
parent_idintegerOptional
password_confirmationstringRequired
Responses
200Success
application/json
Responseany of
or
400
Registeration Success and we return Access Token.
application/json
422
Validation error
application/json
post
POST /api/register HTTP/1.1
Host: cm.test
Content-Type: multipart/form-data
Accept: */*
Content-Length: 178

{
  "name": "text",
  "phone": "text",
  "email": "name@gmail.com",
  "password": "text",
  "front_id": "binary",
  "back_id": "binary",
  "relation_type": null,
  "parent_id": 1,
  "password_confirmation": "text"
}
{
  "status": true,
  "message": "User registration success",
  "data": {
    "token": "text"
  }
}

Reset Password

post

You can send reset password request by use this APIs.

Body
emailstringRequired
Responses
200
OTP Send Success Using Service Provider.
application/json
404
Sorry User Not Found!.
application/json
422
Validation error
application/json
post
POST /api/reset HTTP/1.1
Host: cm.test
Content-Type: application/json
Accept: */*
Content-Length: 16

{
  "email": "text"
}
{
  "status": true,
  "message": "An OTP Has been send to your email please check it"
}

Resend OTP

post

You can resend OTP by use this API.

Body
emailstringRequired
Responses
200
OTP Send Success Using Service Provider.
application/json
422
Validation error
application/json
post
POST /api/resend HTTP/1.1
Host: cm.test
Content-Type: application/json
Accept: */*
Content-Length: 16

{
  "email": "text"
}
{
  "status": true,
  "message": "An OTP Has been send to your email please check it"
}

Check OTP & Active Account

post

You can check OTP is vaild by use this API and active the user if it's vaild.

Body
emailstringRequired
otp_codestringRequired
Responses
200
OTP is vaild and the account has been activated.
application/json
400
Sorry OTP is not vaild or expired you can generate new one by resend.
application/json
404
There is not account releated to this email/phone.
application/json
422
Validation error
application/json
post
POST /api/otp HTTP/1.1
Host: cm.test
Content-Type: application/json
Accept: */*
Content-Length: 34

{
  "email": "text",
  "otp_code": "text"
}
{
  "status": true,
  "message": "your Account has been activated"
}

Check OTP

post

You can check OTP is vaild by use this API.

Body
emailstringRequired
otp_codestringRequired
Responses
200
OTP is vaild and the account has been activated.
application/json
400
Sorry OTP is not vaild or expired you can generate new one by resend.
application/json
404
There is not account releated to this email/phone.
application/json
422
Validation error
application/json
post
POST /api/otp-check HTTP/1.1
Host: cm.test
Content-Type: application/json
Accept: */*
Content-Length: 34

{
  "email": "text",
  "otp_code": "text"
}
{
  "status": true,
  "message": "your Account has been activated"
}

Change Password

post

If the request of change password has been send success you can change the password with OTP form here.

Body
passwordstringRequired
password_confirmationstringRequired
Responses
200
OTP is vaild and the password has been changed.
application/json
400
OTP is not vaild or expired please resend it.
application/json
404
Sorry User Not Found!.
application/json
422
Validation error
application/json
post
POST /api/password HTTP/1.1
Host: cm.test
Content-Type: application/json
Accept: */*
Content-Length: 50

{
  "password": "text",
  "password_confirmation": "text"
}
{
  "status": true,
  "message": "Password Updated"
}

Update User Password

post

You can update user password by use this APIs.

Body
passwordstringRequired
password_confirmationstringRequired
Responses
200
If Your Has Token He Can change the password direct without OTP.
application/json
404
Sorry User Not Found!.
application/json
422
Validation error
application/json
post
POST /api/profile/password HTTP/1.1
Host: cm.test
Content-Type: application/json
Accept: */*
Content-Length: 50

{
  "password": "text",
  "password_confirmation": "text"
}
{
  "status": true,
  "message": "Password Updated"
}

Close Account

delete

You can close your account by send this request, please note that all data for this user will be deleted and you can register again.

Body
objectOptional
Responses
200
The account has been close you can register again
application/json
delete
DELETE /api/profile/destroy HTTP/1.1
Host: cm.test
Content-Type: application/json
Accept: */*
Content-Length: 2

{}
200

The account has been close you can register again

{
  "status": true,
  "message": "Account Has Been Deleted"
}

Logout User

post

You can logout the user by destory tokens and session by use this API.

Body
objectOptional
Responses
200
The user logout success and the tokens destoried.
application/json
post
POST /api/profile/logout HTTP/1.1
Host: cm.test
Content-Type: application/json
Accept: */*
Content-Length: 2

{}
200

The user logout success and the tokens destoried.

{
  "status": true,
  "message": "Logout Success"
}