PHP code example of sayawrt / unik-id

1. Go to this page and download the library: Download sayawrt/unik-id library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sayawrt / unik-id example snippets

bash
  public function store(Request $request){

	$id = IdGenerator::generate(['table' => 'todos', 'length' => 6, 'prefix' => date('y')]);

	$todo = new Todo();
	$todo->id = $id;
	$todo->title = $request->get('title');
	$todo->save();

}