PHP code example of jtkendall / kurin

1. Go to this page and download the library: Download jtkendall/kurin 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/ */

    

jtkendall / kurin example snippets


use jtkendall\Kurin;

$results = Kurin::fromCSV('data/example.csv', ['id', 'name']);

use Illuminate\Database\Seeder;
use jtkendall\Kurin;

class ExampleTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $examples = Kurin::fromCSV(storage_path('app/example.csv'), ['id', 'name', 'slug', 'description']);

        DB::table('examples')->insert($examples);
    }
}

use jtkendall\Kurin;

$results = Kurin::fromCSV('data/example.csv', ['id', 'name'], ['created_at', 'updated_at']);