当我试图在我的终端上执行$ php artisan passport:install时收到一个错误,我将粘贴到下面: In AuthServiceProvider.php line 26:
Class 'App\Providers\Passport' not found 我怀疑这个问题在我的config/auth.php中,所以我将链接下面的内容(删除评论): <?php
return [
'defaults' => [
我在我的Laravel 8.12中遇到了身份验证问题,我正在使用默认的Laravel fortify 1.7.8,我使用正确的凭据登录,应用程序按我想要的方式重定向到仪表板,但中间件身份验证似乎不起作用,而且Auth::user()也返回null。
用户模型
<?php
namespace App\Models;
use App\Models\LoginHistoric;
use App\Traits\Uuids;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundatio
我刚刚开始使用service providers,l对service contains非常困惑,而Laravel l搜索了一些示例,比如follow的服务代码:
namespace App\Service;
class Tests
{
public function test()
{
echo "aaa";
}
}
服务提供者的代码
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class TestServiceProvider extends S
PHP Fatal error: Class 'App\Providers\Route' not found in /home/****/**********/app/Providers/RouteServiceProvider.php on line 28
[Symfony\Component\Debug\Exception\FatalErrorException]
Class 'App\Providers\Route' not found
上面是我在尝试运行Artisan时看到的错误。这个问题似乎与我的过滤器(我正在尝试从Laravel
我的Composer Service Provider如下所示: <?php
namespace App\Providers;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;
use Illuminate\Http\Request;
use App\Http\ViewComposers\DashboardComposer;
use App\companies;
use App\user;
class ComposerServiceProvider extends Servi
我知道这个问题被问了很多次,但没有一个答案对我有帮助。
我在Laravel 5中遇到异常
BindingResolutionException in Container.php line 785:
Target [App\Contracts\CustomModelInterface] is not instantiable.
我做过但没有成功的事情:
如果我替换了providersphp artisan clear-compiledEverything中存储库上的接口,则 container?).中的app.php 注册App\Providers\AppRepositoryProvider可以
我创建了一个新文件夹ViewComposers并添加了一个新文件ViewComposer.php。Path = App/Http/ViewCompers/ViewComper.php
下面是我的代码
<?php namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class ViewComposer extends ServiceProvider{
public function boot(){
view()->composer('*', function
我创建了一个服务提供者,并在app.php中添加了提供程序,但是如何使用它呢?
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use App\Helpers\api\gg\gg;
class ApiServiceProvider extends ServiceProvider
{
protected $defer = true;
public function boot()
{
}
public function register(
我遵循了Laravel.com上的升级指南。在完成之后,我完成了作曲家更新,我偶然发现了这个error.Does --有人知道如何解决这个问题吗?
谢谢你帮我
FatalThrowableError in RouteServiceProvider.php line 73:
Class 'App\Providers\Route' not found
routeserviceprovider.php
<?php
namespace App\Providers;
use Illuminate\Routing\Router;
use Illuminate\Foundation\
很抱歉,新手的问题,但我找不到任何例子,如何实际使用服务提供商(Laravel文档只显示如何创建他们)。
因为Laravel的分页器不适合分组,所以我想创建自己的分页器服务,但我不知道如何将所述服务注入控制器。论坛控制器抛出异常:Class App\Http\Controllers\CustomPaginator does not exist,但我认为如果我将服务类绑定到服务容器,它可以使用自定义名称进行解析吗?
以下是这些文件:
app/Http/Controllers/For
<?php
namespace App\Http\Controllers;
use App\ForumM
我正在尝试允许用户在Laravel5.5中编辑他们自己的评论
AuthServiceProvider.php
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use App\Model\Review;
use App\Policies\ReviewPolicy;
class AuthServiceProvider extends
我尝试在Laravel5.4中创建一个新的自定义类来检查用户类型。
我将这个新类添加到一个新的文件夹应用程序\ItS卷积中,代码:
<?php
namespace App\ItSolution;
class DemoClass {
public function getPermission() {
switch(Auth::user()->user_type_id) {
case 1:
return 'admin';
break;
我有一个自定义的中间件,我想使用一个单例来将php变量传递到我的前端,但是我得到了以下错误: ReflectionException (-1)
Class App\Http\Middleware\Javascript does not exist 我的中间件: <?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Auth;
class AuthAdmin
{
public function handle($request, Closure $next