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/ 

laravel highchart

Wednesday, July 27, 2016

Question - Laravel where dob like $str not working. dob is a date field.

 Laravel where dob like $str not working. dob is a date field.

For example dob is 1972-05-28. When I search with $str=1972 it not working.

return $this->builder->where('name','
like', '%'.$str.'%')
                                 ->orWhere('nric','like', '%'.$str.'%')
                                 ->orWhere('dob','like', '%'.$str.'%');

-------------------------------------------------
Answer :
            return $this->builder->whereRaw("cast(dob as char(10)) like '%$str%'")
                                 ->orWhere('name','like', '%'.$str.'%')
                                 ->orWhere('nric','like', '%'.$str.'%');

Tuesday, July 26, 2016

Dialy note 27-Jul-2018


1. Current status -- complete deposit prototype.




2.To do list for deposit
   a. rename table name
   b. add move in/out date
   c. add utility amount and comments column
   d. update delete function with change move_out flag value.

3. Add search function on all the index screen.

4.  Start working on rental charge and collection.


    

Thursday, July 21, 2016

Cari form info

1. cari yc_chan
我们有提供做网站的服务, 一站式的服务. 我们也有做custom made 的 system, 完全符合你的要求而设。

从 Domain name + Website + web hosting 包到完 。

http://www.webonhand.com

Whatsapp :014-9254526
email : admin@webonhand.com

2.vronn12345
tideweb.my

3. http://www.grow.my/

Sunday, July 17, 2016

appzcoder crud-generator


1.url
https://packagist.org/packages/appzcoder/crud-generator

2. Crud command: .
php artisan crud:generate Posts --fields="title#string, body#text"
 
3. You can also easily include route, set primary key, set views directory etc 
through options --route, --pk, --view-path as belows: 
php artisan crud:generate Posts --fields="title#string#required, 
body#text#required_with:title|alpha_num" --route=yes --pk=id 
--view-path="admin" --namespace=Admin --route-group=admin 
 
3. These fields are supported for migration and view's form:
  • string
  • char
  • varchar
  • password
  • email
  • date
  • datetime
  • time
  • timestamp
  • text
  • mediumtext
  • longtext
  • json
  • jsonb
  • binary
  • number
  • integer
  • bigint
  • mediumint
  • tinyint
  • smallint
  • boolean
  • decimal
  • double
  • float
  • enum
 

Tuesday, July 5, 2016

sample application 6-Jul-2016

http://laravel-tricks.com/popular
http://builtwithlaravel.com/listing/laravel-tricks

https://github.com/wiwatsrt/laravel-property-management.git

Saturday, July 2, 2016