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
1
vote
3 answers

Laravel Facade and Service Provider

This is my first time using Laravel's Facades and Service Providers (I'm on Laravel 5). I have this ServiceProvider:
ajon
  • 7,868
  • 11
  • 48
  • 86
1
vote
0 answers

Laravel 5.1: confused by the way namespaces and facades work within PHPUnit Test classes extending TestCase

I'm creating base test class from which other test classes can extend from and be ran with PHPUnit. This base test class extends Laravel's provided TestCase class. Also, I'm using the PHP Faker library to create a faker generator and as, well, I'm…
racl101
  • 3,760
  • 4
  • 34
  • 33
1
vote
0 answers

Renaming a facade - conflicts

I am trying to use the vinkla/pusher package with Laravel 5.1. It is a common known issue that the facades don't work because of a conflict: https://github.com/vinkla/pusher/issues/2 A solution is to rename the facade. How would I go about doing…
KriiV
  • 1,882
  • 4
  • 25
  • 43
1
vote
2 answers

Laravel - override default facade bindings - how?

http://laravel.com/docs/5.1/facades Facades are listed on the linked page at the bottom. My question is... How do I override these service container bindings? Example, the Request facade binds Illuminate\Http\Request with the key request. I want to…
morgoth84
  • 1,070
  • 2
  • 11
  • 25
1
vote
3 answers

Laravel - Unable to make PHP-Vars-To-Js-Transformer package work

I'm new to Laravel 5 and I was trying to set up PHP-Vars-To-Js-Transformer .The problem is, that I'm unable to use JavaScript facade in my controller. This class is not found. My Controller:
user2151486
  • 778
  • 2
  • 13
  • 25
1
vote
2 answers

Laravel 5 image class conflict

I have a image model, but after I have started using intervention image to resize images, I have a problem with class conflict because they both have the class name Image. I have tried to change the alias in app.php, so that intervention facade name…
Andreas Baran
  • 669
  • 1
  • 12
  • 27
1
vote
1 answer

Searching for Schema:table static method definition in Laravel Framework

I'm trying to understand PHP Laravel Framework. Whend dealing with databases, we use Schema::table to create a table in the database. Searching in my application I find the only definition is
Caco
  • 1,601
  • 1
  • 26
  • 53
1
vote
1 answer

Dependency Injection in Laravel 5 Package To Use or Not To Use

I am developing a package for Laravel 5, I decided to benefit from dependency injection in my package when using the Core classes of Laravel, but after reading more and also having asked this question Best approach for Dependency Injection in…
Siavosh
  • 2,314
  • 4
  • 26
  • 50
1
vote
0 answers

Why isn't Laravel's Response Facade a Facade?

If you look at the Laravel's configuration, you'll see an alias has been setup for the symbol Response 'aliases' => array( 'Response' => 'Illuminate\Support\Facades\Response', The namespace on the actual class, and Laravel's general…
Alana Storm
  • 164,128
  • 91
  • 395
  • 599
0
votes
1 answer

Get Only the value of field mongodb using laravel

My question is similar with NodeJS get only value of MongoDB result. But in this case, i'm using laravel. This is my controller : public function validation(Request $request) { $email= $request->input('email'); $password=…
0
votes
0 answers

Why the 'request' key is not in the binding's array in the container when I dd(app())

To my understanding, the 'request' key returned by the getFacadeAccessor method in the Request Facade, refers to the key bound in the service container in the bindings array. And when I dd(app('request')) I get the Request object. However, when I…
Alphy Gacheru
  • 489
  • 1
  • 9
  • 28
0
votes
0 answers

Get sum by laravel subjoin

I'm using an online woocommerce shop. I have several suppliers for my goods. and when my order is saved I save each item's supplier. Now I'm trying to query my database via laravel. this is my query by laravel's database facade which works…
ED SA
  • 1
  • 1
0
votes
0 answers

How to iterate through this collection in Laravel 9?

An API returns this data when I do dd(). How do I iterate through results and retrieve eg. originalFileUrl? MyApp\Response\FileListResponse {#2160 ▼ // app/Http/Controllers/MyController.php:24 -next: null -previous: null -total: 43 -perPage:…
bart
  • 14,958
  • 21
  • 75
  • 105
0
votes
1 answer

Laravel Filament library magic

I know Laravel use Facades and Containers that overload class methods, but when I read the documentation of Filament I see a method called by the Filament facade and this method is named "serving". So I decided to make a search with VS Code in all…
hunterd
  • 48
  • 8
0
votes
1 answer

Laravel storage exists() returns false for file names with spaces

I'm trying to check if file exists using storage exists() function. This function returns true if file name doesn't have spaces but false otherwise. I'm trying to use Storage facades code as follows if (Storage::disk("local")->exists($model->path))…