laravel

  • Ramai salah satu komponen penting dalam MVC adalah Routing. Capaian setiap maklumat dikawal melalui route yang telah didefinasikan.  Cthnya: http://www.ghazali.tajuddin/ http://www.ghazali.tajuddin/membership http://www.ghazali.tajuddin/membership/1/edit Tetapi bagaimana sekiranya terdapat capaian secara tidak sengaja kepada route yang tidak didefinasikan? Error lah jawapannya, atau lebih tepat NotFoundHttpException Exception. Sudah pastinya tak manis bila bila tetamu sampai ke ruangan yang salah,…

    Baca catatan

  • Sedar tak sedar ada banyak juga buku aku beli online. Mostly buku programming ler. Mostly format PDF. Pernah juga beli hardcopy, tapi lebih practical dalam softcopy. Senang nak share dan copy source code. Selepas bayar terus bleh download, kalau hardcopy mungkin ambil masa untuk courier ke Malaysia pulak. So hari ni aku nak review sebuah…

    Baca catatan

  • Update Composer.json tukar dependencies framework 5.4 kepada 5.5  “require”: { “php”: “>=5.6.4”, “laravel/framework”: “5.5.*”, //<– tukar drpd 5.4.* “laravel/tinker”: “~1.0” }, tukar php unit 5.6 kepada 5.7 “require-dev”: { “fzaninotto/faker”: “~1.4”, “mockery/mockery”: “0.9.*”, “phpunit/phpunit”: “~5.7″//<– tukar daripada 5.6 }, run composer update composer update Boleh refer https://laravel.com/docs/5.5/upgrade https://laracasts.com/discuss/channels/laravel/upgrading-to-55-from-51  

    Baca catatan

  • There is a lot special functions that helps simplified our code like this Looking for more? Visit here or https://laravel.com/docs/5.3/eloquent-collections.

    Baca catatan

  • Middleware is a class that have special function in Laravel. Middleware placed in between the User and  Apps.  Before you can access the Apps, Middleware will do his job first. We can use Middleware to do several thing Do you authenticated? What is your role? Do you authorized? Can you perform this action? etc class MemberMiddleware…

    Baca catatan

  • This is examples how Laravels handle exceptions. try{ .. .. Business Logic .. .. } catch(ThrottlingException $e){ $delay = $e->getDelay(); return redirect()->response->withErrors(“You are banned for $delay seconds.”); } catch(NotActivatedException $e){ return redirect()->response->withErrors(“You account is not activated.”); } Not to forget at the top of the class use Cartalyst\Sentinel\Checkpoints\ThrottlingException; use Cartalyst\Sentinel\Checkpoints\NotActivatedException;

    Baca catatan