Monday, August 1, 2016

Friday, July 29, 2016

php artisan db:seed

1. DatabaseSeeder.php
use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;

class DatabaseSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        // $this->call(UsersTableSeeder::class);
        $this->call(MarketsTableSeeder::class);      
    }
}

2. MarketsTableSeeder.php
use Illuminate\Database\Seeder;
use App\Market;

class MarketsTableSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        App\Market::create(['name' => 'Direct Sales', 'val'=>20]);
    }
}

3. You need App\Market model as well

4. run command "php artisan db:seed" on command prompt




5. I having class compile error , try 'composer dump-autoload" and "php artisan clear-compiled"
https://laracasts.com/discuss/channels/general-discussion/php-artisan-dbseed?page=1




Thursday, July 28, 2016

factory faker

factory faker step by step.

1. Add $factory on ModelFactory.php
$factory->define(App\Tenant::class, function (Faker\Generator $faker) {
    return [
        'name' => $faker->name,
        'nric' => $faker->numerify('######-##-####'),
        'dob' => $faker->date
    ];
});

2. run with php artisan tinker
 factory('App\Tenant',20)->create();

3. Reference.
https://github.com/fzaninotto/Faker

sample project with budget 15-20k

Customer is looking for property management application with budget 15-20k.

Scope is similar as application below.

 

To do list 29-Jul-2016

1. Research on high chart.

2. Testing on paginate function.

3. Enhance transaction new/edit/delete function.

CMS link

1. MicroweberCMS Drag and Drop CMS and online shop
https://microweber.com/