いつも通りTwitterでLaravelの話をしていたところ、 匿名でいいからディレクトリ構造シェアしてほしいw— たきゃはし (@takahashiyuya) 2016年5月2日 ということがあり、とりあえず自分流のLaravelを紹介します。 2014年にその時の自分の開発プロジェクトなどで利用していたものをまとめました。 blog.comnect.jp.net 新原さんのエントリも参考にしてみると良いでしょう。 www.1x1.jp Laravelは開発者が自由に組み合わせて、自由に構築できるフレームワークという側面があり、 ある程度慣れてきた頃に、みなさん色々試行錯誤すると思います。 RoRっぽさを求めている方はそれの色を求め、 Javaや、エンタープライズ向けのものを求めている方はその色になっていくと思います。 あれから月日が流れ、折角ですので2016年版として自分流のLarav
Laravel/データベースレイヤーとのテスト1 Posted: 2015-05-23 23:11 | laravel PHP全般 5.1が目前ですが、Laravelアプリケーションのテストやってますか? 便利な機能がたくさんあるなかでも、一番人気があるのはEloquentでしょうか? Eloquentを用いたアプリケーションでのテストについていくつか紹介しましょう。 データベースなどを用いた値などのデータレイヤー(リポジトリ、エンティティなど)の実装を シンプルに、ドキュメントなどにある例で実装してみましょう。 (本エントリではモデルという抽象的な表現は用いません。MVCアーキテクチャ一辺倒の内容ではないからです) 一般的な実装例 マイグレーションファイルとして下記のように作成します use Illuminate\Database\Schema\Blueprint; use Illumi
1.以下のミドルウェアを作成するapp/Http/Middleware/EncodingValidateParams.php として、パラメータ値の文字エンコーディングをチェックするミドルウェアを新規に作成します。 <?php namespace App\Http\Middleware; use Closure; class EncodingValidateParams { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { foreach ($request->all() as $val) { if
久しぶりにPHPネタで喋った気がする。 日本初?、もしかすると世界初かもしれないくらいのタイミングでとりあえずlumenについて喋ってきました。 いやぁ、タイミングが良かった。 Lumen使ってみたレポ from mikakane フロントエンドエンジニアの恋人、マイクロフレームワークです。 しかも最近流行りのlaravel製、これは使うしか無い。 silexとかと同じく色々カスタマイズしてオレオレっぽく使うのがオススメです。 Qiitaの方にも色々記事を書きましたので参考になれば。 qiita.com qiita.com qiita.com 基本的にはlaravelと似たような感じなんでlaravelやってる人には取っ付き易いはず。 コンテナのmake周りとかルーティングとかがちょっと変わってるのでそこだけ押さえとけば。 あ、来週5/27にフロントエンドユーザグループでJSフレームワーク
In this blog we take a closer look into CSRF protection in Laravel. We compare the difference between the CSRF filter in Laravel 4 and the current VerifyCsrfToken middleware in Laravel 5. Why do we need CSRF protection? Laravel has CSRF-protection enabled by default. So even if you don’t know what CSRF is, or why you need to protect your apps from it, you’ll probably run in to an Illuminate\Sessio
Laravel 5 is already out, but the fear of change is taking everyone. We keep hearing people complaining about some radical changes. Like, why this new folder structure? Will my application break if I do a composer update? In this article, we’re going to look at how to migrate your existing Laravel 4 application to Laravel 5 and understand the new folder structure. Installation My existing Laravel
These days there is a lot of buzz about software design patterns, and one of the most frequently asked questions is “How can I use some pattern with some technology“. In the case of Laravel and the Repository pattern, I see often questions like “How I can use repository pattern in Laravel 4” or nowadays “..in Laravel 5”. Important thing you must remember is that design patterns do not depend on sp
アライドアーキテクツ Advent Calendar 17日目 兼 Laravel Advent Calendar 2014 17日目 の記事です ごあいさつ Laravel AdventCalendarの総支配人のytakeさんにQiitaのアドベントカレンダーと会社のアドベントカレンダーを一緒くたにして書いてもいいっすか?って聞いたら快諾してくれたので二つのカレンダーを兼ねるというセコいスタイルでいきます。石川さんです。どうぞよろしくお願いします。 まず、この記事は12/09時点のcommitをベースとして書いています。Laravel5は現在開発中であり記事の内容と違う部分が出てくると思います。(ちなみに、これの記事を書くために前から暖めていたサンプルアプリケーションがあったのですが、12/09時点でだいぶ内容変更が行われたために全てゼロから書き直しました。泣ける話ですね。)なお、新機
Database seeding can be a pain to perform and end up very clumsy. Seeding is a process required in the majority of web applications – either for stress testing or just to generate a reasonable sample of test data during testing. Laravel 4 already has database seeding and migrations built in, which of course is great. However, the functionality to generate the actual sample data is lacking. Enter F
Testing controllers isn't the easiest thing in the world. Well, let me rephrase that: testing them is a cinch; what's difficult, at least at first, is determining what to test. Should a controller test verify text on the page? Should it touch the database? Should it ensure that variables exist in the view? If this is your first hay-ride, these things can be confusing! Let me help. Controller tests
If you're hoping to learn why tests are beneficial, this is not the article for you. Over the course of this tutorial, I will assume that you already understand the advantages, and are hoping to learn how best to write and organize your tests in Laravel 4. Version 4 of Laravel offers serious improvements in relation to testing, when compared to its previous release. This is the first article of a
August 11, 2014Data Validation in Laravel: The Right Way – Custom Validators In the previous part we learned how to validate data in Laravel using its in-built data validation package and how to abstract out our data validation to entity specific services to make the code reusable on the principles of DRY. Now, we can easily create a validation service for each entity in our app with its own respe
In this part, we will begin to work with the REST interface. Creating a REST Api on Laravel isn’t very difficult. All we need to keep in mind is that we’re dealing with EmberJS and that we don’t want to write a new adapter from scratch. As usual, you can find the source code for this part on github. Where to start? That is a hard question. Ember has its own workflow and logic. If we begin to write
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く