Questions tagged laravel-facade

Explore the latest questions and answers asked by our top developers.

DB:listen() get query but cancel execution

In a project we have we need to check if a specific connection is called. If the connection is called the query needs to be removed from the transaction but we need the raw query in a log, so the function where the connection is called can not be removed. In the ServiceProvider I created […]

By Kevin
Published
Categorised as database, laravel, laravel-facade Tagged , ,

Transform piece of laravel livewire code into Facade or trait

I’m trying to transform the following piece of code into a Facade. But I don’t know how to call $this in the facade. I want to do this without using $this or passing it as a parameter. Can I somehow dependency inject it? The following piece of code is inside a livewire component which will […]

I get the same row duplicated as the result when I do a simple join using the laravel’s DB facade

Code $result = DB::table(‘disaster_rescue_data’) ->join(‘users’, ‘disaster_rescue_data.username’, ‘=’, ‘users.email’) ->get(); Problem I have this very simple join as mentioned in the above code. However when I render the data on a view or dd the $result, I get the same row duplicated and I can not figure out why. (The rows contain the same data.) (I […]

By gfit21x
Published
Categorised as eloquent, laravel, laravel-5, laravel-facade Tagged , , ,

How to generate phpdocs Facade Laravel on PHPStorm

I want to generate phpdocs on my Facade class without ide_helper.php, how to generate it? Source: Laravel

How to generate PHPDoc Facade Laravel on PhpStorm

I want to generate PHPDoc on my Facade class without ide_helper.php. How to generate it? Source: Laravel

How to mass generate PHPDoc Facade Laravel on PhpStorm

I want to generate PHPDoc on my Facade class without ide_helper.php. How to generate it? Source: Laravel

Laravel : Facade root has not been set

Getting this error after running composer install Laravel version 5.7.29 PHP Version 7.4.16 Please help. Source: Laravel

Laravel Package: How to register a third party facade inside a custom package?

I’m creating a package that uses internally this hashid package. How can I register a third party facade inside a custom package? I tried three options and none of them worked. Version – Composer "aliases": { "Hashids": "VinklaHashidsFacadesHashids" } Version – inside my ServiceProvider with alias class MyPackageServiceProvider extends ServiceProvider { public function register() { […]

VS code tracking a function doesn’t work with Laravel Facade

I really like Laravel Facade when transforming dynamic class to static. For instance, I can easily add the keyword Facades and call it a static class. use FacadesAppServicesMyService; public function something() { $something = MyService::getSomething(); } Normally we can track getSomething() function using Ctrl+click in VS code editor. But with Facades, Ctrl+click doesn’t work. Any […]

Laravel eloquent giving different results from DB facade

I have a laravel eloquent query that is giving me a different result from the same query using the DB facade. I cannot understand why the result would be different. The result set is the same length (6), but the one data object key ha stays the same for the eloquent query (which is not […]

1 2

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq