Tuesday, June 28, 2016

Example str_slug

$str = "this is a test";
$slug = str_slug($str);
var_dump("slug=" .$slug);
$slug2 = $slug . "-2";
var_dump("slug2=" .$slug2);

$pieces = explode("-",$slug2);

$number = intval(end($pieces));

var_dump("number=" .$number);

Daily Note 28-Jun-2016


1. setup timegrid
https://github.com/timegridio/timegrid
https://github.com/timegridio/timegrid/blob/master/INSTALLING.md

2 What next
Study in deep on this framework.

Friday, June 24, 2016

Usefully link


1. glyphicon class
http://www.w3schools.com/bootstrap/bootstrap_ref_comp_glyphs.asp

2. List of open source projects made with Laravel
https://gist.github.com/msurguy/8590765

3.Vocal extends the Eloquent base class, so your models are still fully compatible with Eloquent. Vocal simply intercepts some methods such as validate and save before they're passed to Eloquent.
https://github.com/sjdaws/vocal

4.Josh - Laravel Admin Template + Front End + CRUD
http://codecanyon.net/item/josh-laravel-admin-template-front-end-crud/8754542?ref=jyostna&&utm_source=github&utm_medium=stojan_repo

5.A collection of open-source projects built with the Laravel framework.
http://builtwithlaravel.com/

6.MongoDB based Eloquent model and Query builder
http://builtwithlaravel.com/listing/laravel-mongodb

7.Laravel based CMSs and open source applications
http://learninglaravel.net/laravel-based-cmss-and-open-source-applications

8.PyroCMS is an easy to use, powerful, and modular CMS and development platform built with Laravel 5.
https://github.com/pyrocms/pyrocms

9.Invoice Ninja
https://github.com/invoiceninja/invoiceninja

10. Timegrid helps contractors and customers to find the perfect meeting time through online appointments.
https://github.com/timegridio/timegrid

11. Awesome-opensource-apps
https://github.com/unicodeveloper/awesome-opensource-apps

12. Laravel.io Community Portal
http://laravel.io/forum 

Daily Note 25-Jun-2016

1. explore on Maatwebsite excel traits and enhance my excel function
    Try use traits to build one excel export function.
     Done : Create MaatExcel class

2. Import export excel function on "posts" form.
    Done

3. Add fetchTable class and CommonController.
    Done

4. Looking for billing / transaction laravel application.
    Next step.

Thursday, June 23, 2016

Review: Top 5 Laravel-based CMSs

http://laraveldaily.com/review-top-5-laravel-based-cmss/

Online Business Solution

Good site to reference.

https://www.stooges.com.my/en

JB 的话可以和我合作 ^^.
0167737062 Derrick Yam

Wednesday, June 22, 2016

Daily Note 22-Jun-2016

1. Create downloadExcel function.

2. Retrieve data from compact array
$temp = $data['data'];

3. git commit -m "add downloadExcel into helper function"

4. What next
    Implement export to excel to "posts" CRUD.

Tuesday, June 21, 2016

My project plan 21-Jun-2016

1. New project -- myproj
   Done

2. Setup database on postgres -- under database test scheme public
   Done

3. import Crud Generator
   https://github.com/appzcoder/crud-generator
   Done

4. import Maatwebsite/Laravel-Excel
   https://github.com/Maatwebsite/Laravel-Excel
   Target complete date : 22-Jun-2016. (Done)

5. git initial commit and push the github myproj
    Done

6. Add export excel function on post.show
    Target complete date : 22-Jun-2016.

7. Start design and build property management system
    Target complete date : 31-July-2016.

Thursday, June 16, 2016

git: Crud Generator

1. github
https://github.com/appzcoder/crud-generator

2. setup
php artisan vendor:publish --provider="Appzcoder\CrudGenerator\CrudGeneratorServiceProvider"
php artisan crud:generate Posts --fields="title#string, body#text"

3. Screen dump

Common laravel issues and fix

1.ErrorException in Encrypter.php line 81:
https://laracasts.com/discuss/channels/general-discussion/mcrypt-encrypt-key-of-size-12-not-supported-by-this-algorithm

==> resolve
C:\wamp\www\app>php artisan key:generate
Application key [HaQQ7Mcdfr1KpJ17Khs2P5vrrWWJifUf] set successfully.


2. Maximum function nesting level of '100' reached, aborting!
I fixed this my add this line to bootstrap/autoload.php in LV 5.1

ini_set('xdebug.max_nesting_level', -1);

https://laracasts.com/discuss/channels/general-discussion/l5-maximum-function-nesting-level-of-100-reached-aborting?page=4


3.TokenMismatchException in VerifyCsrfToken.php line 67:
http://laravel.io/forum/01-30-2015-laravel5-tokenmismatchexception-in-verifycsrftoken
<input type="hidden" name="_token" value="{{ csrf_token() }}">

Note 16-Jun-2016

1. Finish lesson incremental api development
https://laracasts.com/series/incremental-api-development
https://github.com/rattfieldnz/laravel-incremental-api.git

2.  fractal provides a presentation and transformation layer for complex data output
    fractal.thephpleague.com

3. php artisan generate:pivot lessons tags   
this will create pivot table refer to CreateLessonTagTable
    public function up()
    {
        Schema::create('lesson_tag', function(Blueprint $table)
        {
            $table->increments('id');
            $table->integer('lesson_id')->unsigned()->index();
            $table->foreign('lesson_id')->references('id')->on('lessons')->onDelete('cascade');
            $table->integer('tag_id')->unsigned()->index();
            $table->foreign('tag_id')->references('id')->on('tags')->onDelete('cascade');
        });
    }

4. thinking about if added new field what is the impact.   

5. abstract class   
Abstract classes are classes that contain one or more abstract methods. An abstract method is a method that is declared, but contains no implementation. Abstract classes may not be instantiated, and require subclasses to provide implementations for the abstract methods.
  
7.  Traits and classes is defined in a way which reduces complexity, and avoids the typical problems associated with multiple inheritance and Mixins

As of PHP 5.4.0, PHP implements a method of code reuse called Traits.

Traits are a mechanism for code reuse in single inheritance languages such as PHP. A Trait is intended to reduce some limitations of single inheritance by enabling a developer to reuse sets of methods freely in several independent classes living in different class hierarchies. The semantics of the combination of Traits and classes is defined in a way which reduces complexity, and avoids the typical problems associated with multiple inheritance and Mixins.

A Trait is similar to a class, but only intended to group functionality in a fine-grained and consistent way. It is not possible to instantiate a Trait on its own. It is an addition to traditional inheritance and enables horizontal composition of behavior; that is, the application of class members without requiring inheritance.

Tuesday, June 14, 2016

My project plan 14-Jun-2016

1. Try to build property management system in two months time. End Date 31-Aug-2016.

2. Use basic MVC to build as long as it work.

3. Explore at less two CRUD to enhance this system.

4. Re-build using simplify framework.

5. Conclusion.

Sunday, June 12, 2016

My project plan 12-Jun-2016

Plan

1. Master on my own laravel framework.
2. Create my own property project.

Job Option

1. Change job with doing php laravel.
     Will start with part time or freelance basic.
2. Looking for part time job or freelance
3. Post deployment maintenance