Search
 
SCRIPT & CODE EXAMPLE
 

PHP

order number generate laravel

$order = new Order;

$order->user_id = Auth()->id();
$latestOrder = AppOrder::orderBy('created_at','DESC')->first();
$order->order_nr = '#'.str_pad($latestOrder->id + 1, 8, "0", STR_PAD_LEFT);
$order->save();
Comment

order number generate laravel

public function get_order_number()
{
    return '#' . str_pad($this->id, 8, "0", STR_PAD_LEFT);
}
Comment

PREVIOUS NEXT
Code Example
Php :: change php version in vagrant 
Php :: php konstanten 
Php :: laravel validation allow empty array 
Php :: how to disable register route in laravel 
Php :: concat() function using laravel eloquent query 
Php :: wordpress echo the date in post 
Php :: Install the php_mysql extensions 
Php :: deleteall in cakephp 
Php :: array_search 
Php :: laravel validation max string length 
Php :: php connect ms sql server 
Php :: wordpress disable file mods 
Php :: php current page url 
Php :: while loop php 
Php :: how to install multiple php versions ubuntu 
Php :: PHP Warning: Version warning: Imagick was compiled against Image Magick version 1654 but version 1650 is loaded. 
Php :: wpdb-prepare 
Php :: laravellivewire is not defined 
Php :: cache clear in laravel 
Php :: php remove prefix from string 
Php :: random string php 
Php :: laravel check record exists 
Php :: centos update php 7 to php 8 
Php :: Laravel - Comparison betweeon two column values - whereColumn 
Php :: Fatal error: Cannot redeclare 
Php :: php import python script 
Php :: php random 5 digit number 
Php :: php syntax 
Php :: get post url from post id wordpress 
Php :: strval in php 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =