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-