Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Laravelの良いところ

752 views

Published on

PHP勉強会 東京 vol.121でのスライドです。

Published in: Technology
  • Be the first to comment

Laravelの良いところ

  1. 1. Laravel @fagai
  2. 2. Profile • (@fagai) • • CALISTA Inc. • Laravel ( phalcon) • /
  3. 3. Laravel
  4. 4. PHP • PHP • v5.5 PHP7 • v5.1 PHP5.5.9
  5. 5. Laravel Laravel5.1
  6. 6. Laravel • ( IoC ) • ( ) • Symfony Component • (Service Provider) •
  7. 7. DI • Laravel • new • ( )
  8. 8. DI
  9. 9. // app()->bind(PersonInterface::class, Alice::class); app()->make(PersonInterface::class); // Alice new // app()->bind(FugaInterface::class, function($app) { return new Fuga(‘aaa’); }); // app()->extend(PersonInterface::class, function($person, $app) { $person->extend = ‘extend’; return $person; });
  10. 10. • • Laravel •
  11. 11. Laravel • ( ) • (Reflection) •
  12. 12. • new • = ( ) • = ( )
  13. 13. BookController@index
  14. 14. class BookController extends Controller { protected $service; public function __construct(BookService $service) { $this->service = $service; } public function index(Request $request) { // } } class BookService { protected $bookRepository; public function __construct(BookRepositoryInterface $bookRepository) { $this->bookRepository = $bookRepository; } } app()->bind(BookRepositoryInterface::class, BookRepository::class);
  15. 15. • BookController index (※1) • BookController BookService (※2) • BookService (※1) • BookService BookRepositoryInterface (※2) • BookRepositoryInterface BookRepository BookRepository (※1) BookService • BookController index Request (※2) (※1)
  16. 16. Laravel • • • •
  17. 17. • PHP • •

×