Search
 
SCRIPT & CODE EXAMPLE
 

PHP

How I can generate the unique transaction ID in laravel 8

class Transaction extends Model {
 ...
 public static function boot()
 {
        parent::boot();
        self::created(function ($model) { 
            $model->transaction_id = 'NMB-BOO-' . str_pad($model->id, 7, "0", STR_PAD_LEFT);
            $model->save();
        });
 }
}
Comment

PREVIOUS NEXT
Code Example
Php :: php return associative array 
Php :: italic text in laravel notification 
Php :: swagger laravel 
Php :: codeigniter 4 radio button isset 
Php :: rodar migration laravel 
Php :: how to get favicon with Goutte php 
Php :: storefront remove sidebar from product page 
Php :: empty func php 
Php :: how to reverse a string in php 
Php :: remove MainWP Child phpmyadmin 
Php :: laravel 7 requirements 
Php :: laravel reoute return string 
Php :: laravel pest assertstatus 
Php :: php move in array 
Php :: PHP - AJAX and MySQL 
Php :: echo placeholder image if post thumbnail not found 
Php :: wc php get shipping methods 
Php :: php configuration file location in centos 8 
Php :: required_unless laravel 
Php :: PDO::ATTR_EMULATE_PREPARES = true Security issue 
Php :: php check if stdclass object has property 
Php :: laravel route parameters 
Php :: Sending HTML Code Through JSON 
Php :: laravel 8 model filter 
Php :: paginate array before more results php 
Php :: laravel route limit parameter 
Php :: get the user detail inside the constructor Laravel 
Php :: only get selected value from has many ralation laravel 
Php :: how to use or where in laravel 
Php :: login form tutorialpoint 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =