Questions tagged [laravel-facade]

Facades in Laravel framework provide a "static" interface to classes that are available in the application's IoC container.

Facades provide a "static" interface to classes that are available in the application's IoC container. Laravel ships with many facades, and you have probably been using them without even knowing it! Laravel "facades" serve as "static proxies" to underlying classes in the IoC container, providing the benefit of a terse, expressive syntax while maintaining more testability and flexibility than traditional static methods.

168 questions
0
votes
1 answer

Unknown HTML facade in Blade template

I am trying to add bootstrap template to my Laravel project . Presently i am using Laravel 5.2 and it gives the following error. FatalErrorException in 309d94eeb37e8691a8ebbde32df9440f6af8f59a.php line 11: Class 'HTML' not found My…
Murali
  • 9
  • 6
0
votes
1 answer

Laravel 5 mail doesn't work

I'm working right now with a Laravel 5.1, for some reason my code, even thou it looks fine, doesn't work properly. I'm trying to make my app send an email with a view as a message. public function sale(Request $request, $id) { $laptops =…
0
votes
0 answers

Laravel5 Facade not resolved

I've registered a service provider in config/app.php, it's being loaded and executed. In the service provider register() method: \App::bind("timer", function() { return new Foo\Utils\Timer(); }); Next, i have created the facade like…
brazorf
  • 1,943
  • 2
  • 32
  • 52
0
votes
1 answer

Laravel5, I like to place Event::listen() in a separate file, but the Event facade was unknown

I would like to have a set of Event::listen()s in a separate file, this is what I have done so far. bootstrap/autoload.php ... require __DIR__.'/../bootstrap/listeners.php'; bootstrap/listeners.php
Artisan
  • 4,042
  • 13
  • 37
  • 61
0
votes
1 answer

Is there a way to make netbeans navigate to Laravel 5 Facade classes?

I'm using Netbeans to work on a Laravel 5 application, and Laravel 5 encourages you to define aliases (called Facades) for certain classes. You can then extend these aliases in your class. However, Netbeans IDE won't let you click-through…
0
votes
2 answers

Laravel Illuminate\Support\Facades\Input

I am new to Laravel and checking out some sample code. In a controller I see this:
user2722667
  • 8,195
  • 14
  • 52
  • 100
-1
votes
2 answers

Uncaught RuntimeException: A facade root has not been set in Laravel

I'am getting below error: [Fri Aug 18 14:31:50 2023] PHP Fatal error: Uncaught RuntimeException: A facade root has not been set. in /home/..../vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:258 Laravel version is 8 and PHP…
Smily CK
  • 29
  • 6
-1
votes
1 answer

How to make Laravel Facades use their own attributes?

I created a CalendarResource class, that I want to call statically using a Facade:
JanBoehmer
  • 395
  • 3
  • 14
-1
votes
1 answer

Is there an easy way to get directory names without full path in Laravel?

I'm trying to get all folder names from a sub folder. I used the following : $lang = File::directories('resources/lang/'); And the result looks like : [ "resources/lang/da", "resources/lang/de-CH", "resources/lang/de-ES", …
-1
votes
1 answer

How to use DB:: from helper class

I have a helper class name common.php in App\Helpers folder. I want to use DB:: facade here to use some db table. In helper method My code is - latest('id')->first(); …
mahbub
  • 103
  • 1
  • 3
  • 13
-1
votes
2 answers

How to use redis "memory usage keyname" command with laravel facade redis? we can use all command except memory command

We can use below commands in laravel. $user = Redis::get('user:profile:'.$id); $values = Redis::lrange('names', 5, 10); $values = Redis::command('lrange', ['name', 5, 10]); but can't use memory usage keyname command with laravel redis facade.
-1
votes
1 answer

MySQL query convert in Laravel DB query

This is a product catalog page, and I need to get 1 image for a preview. My query now: DB::select('SELECT h.* , (SELECT link FROM media_libs m where h.id=m.have_videos_id limit 1)…
-1
votes
1 answer

A facade root has not been set

Laravel 6.5 Laravel Browser Kit ^5.1 I am creating my own packages for something I building and one is causing the issue at hand: A facade root has not been set. when I run my tests. This is routes file App\Game\routes\web.php:
TheWebs
  • 12,470
  • 30
  • 107
  • 211
-1
votes
1 answer

How use Laravel Mail facade outside app folder

i do a script on root of my site. This script is lauch by cron. At the end of script, i try to send mail with the result of process by use Mail facade laravel, but it doens't work. On the top of my script i put this: …
Stephsen
  • 11
  • 1
-1
votes
1 answer

Error: Class 'Flash' not found in laravel 5.2

Actually,I am building an email verification system. After clicking on the generated link in my email ,i am getting the above mentioned error. error: Class 'Flash' not found my file: http://laravel.io/bin/jQxe6
1 2 3
11
12