laravel-facade

    2熱度

    1回答

    在我的應用程序中,我有事件和用戶models.Because的事件模型,我必須把它放入命名空間.so我創建命名空間爲以下。 事件 <?php namespace App\Models; class Event extends \Eloquent { public function user() { return $this->belongsTo('User');

    0熱度

    2回答

    我是新來的Laravel,檢查出一些示例代碼。 在控制器我看到這​​一點: <?php use Illuminate\Support\Facades\Input; class RegistrationController extends \BaseController { public function __construct() { $this->beforeFilter

    6熱度

    4回答

    什麼,我之前已經做是使用構造只有我的模型和使用外牆爲Laravel的提供的類即Session,Auth,Validator等,例如注射。如果我通過構造並通過$this->..語法或注入每個類(我的或Laravel的),我是否應該使用構造函數注入我自己的類,並使用Facades來提供Laravel提供的任何東西,是否會成爲的好主意? 更具體地講,這裏是我的控制器通常是這樣的: class MyCon

    5熱度

    1回答

    只想說我不知道​​我在做什麼...... 我有一個user_info表中,看起來像這樣 Schema::create('user_info', function(Blueprint $table){ $table->increments('id'); $table->unsignedInteger('user_id'); $table->foreign('use

    1熱度

    2回答

    我知道外牆是如何工作的,我可以在Laravel找到充門面名單: https://laravel.com/api/5.2/Illuminate/Support/Facades.html 但我怎麼能看到所有可用的功能對每個門面? 如果我使用Session門面我可以: 查找方法laravel文檔 - 每班 https://laravel.com/docs/5.2/session 搜索方法在Illumin

    5熱度

    1回答

    在我的獨立(不包含Laravel)項目中,我想使用Illuminate IoC容器。另外我想通過App訪問應用程序容器由illuminate/support組件提供的外觀。我安裝了這兩個組件(v5.0.28)。這是我(簡化)代碼: function setup_App(){ $container = new Illuminate\Container\Container(); I

    1熱度

    1回答

    我有一個門面(在這種情況下單),我就用ServiceProvider註冊: 服務提供商 use App; class FacilityServiceProvider extends ServiceProvider { public function register() { $this->app->singleton('Facility', function

    2熱度

    2回答

    我正在嘗試將工匠注入到服務中,以便避免使用正面。 望着外觀類參考我可以看到,我應該注射類: Illuminate\Console\Application 所以我認爲這樣做: <?php namespace App\Service; use Illuminate\Console\Application; class DummyDataService { /**

    1熱度

    1回答

    我正在爲我的Laravel 5.1.17應用程序製作自定義外觀。我一直按照Laravel documentation以及this tutorial的步驟行事,事實上我能夠爲我的定製服務創建自定義外觀。 然而,它突然間破裂了。該錯誤消息我得到的是: FatalErrorException in Facade.php line 207: Call to undefined method App\Fa

    3熱度

    1回答

    我剛開始用laravel並希望瞭解這... 可以說,我們已經在我們的應用程序類: ​​ 什麼是創造一個門面和服務提供商的優勢只是用它作爲 use App\Tests\MyTest; //... controller declarations here .... public function someaction(){ $mt = new MyTest(); $mt-