Skip to main content
Filter by
Sorted by
Tagged with
3 votes
1 answer
76 views

I have an invokable action class called: AttachMembersToRoom . Now, aside from basic form request validations, I also have complex validation, like comparing values across members, identify ...
ssrsvn's user avatar
  • 33
0 votes
1 answer
123 views

GET|HEAD blogs ..................................................................................... blog.index › Blog\BlogController@index POST blogs ...............................
Bikash Chowdhury's user avatar
5 votes
2 answers
13k views

I want to add service provider in laravel 11, but i am not sure how to add it using laravel 11. As previous version of laravel, it is added in config/app.php file, but in laravel 11 it needs to be ...
Isha's user avatar
  • 179
1 vote
0 answers
315 views

Context: From a Laravel service container, we can easily bind abstracts to concrete implementations, and variables to scalar types, using the following, respectively: // Abstracts to concrete ...
exastris's user avatar
1 vote
0 answers
164 views

I just made changes to the application structure for my Laravel application. It works well when runnning tests (for the Http controllers). The problem is when i try to run artisan commands (that ...
Azvya Erstevan's user avatar
0 votes
0 answers
134 views

Would like to build in a simple validation for the value of the APP_ENV parameter in my Laravel application. I want the parameter to be either dev, tst, acc or prd. If it's not one of these, my ...
Lucas Johnston's user avatar
0 votes
1 answer
81 views

I have an interface that I wish to resolve on controllers. On registration inside a service provider, I am binding a class to the Service on condition. Here is my service interface and two classes. ...
John's user avatar
  • 393
0 votes
0 answers
425 views

Followed every step from laravel 9 manual, and my service will not register consistently. Don't quite know why but it suddenly breaks and I receive a Target class [thumbnail] does not existerror out ...
thomi's user avatar
  • 1,697
2 votes
1 answer
1k views

I'm trying to set filesystem configuration value dynamically in controller level. (I think it's almost impossible). For example: 'sftp' => [ 'driver' => 'sftp', 'host' => ...
LoveCoding's user avatar
  • 1,201
4 votes
3 answers
2k views

What I want to achieve is I have a service class name 'SmsService' <?php namespace App\Services; use App\Contracts\SmsServiceContract; use App\Models\Student; use Twilio\Rest\Client; class ...
Shahrukh's user avatar
  • 498
0 votes
2 answers
145 views

I am using Laravel 8. I want to know the difference between new User() and User::class because I am having trouble while using new User(). Here is the scenario, I have UserServices class in which I am ...
Ahmar Arshad's user avatar
3 votes
0 answers
263 views

I got a question. Is it best practice to define gates in custom service providers? I am writing a permission system in Laravel by defining gates for each permission. I created a custom service ...
Dennis's user avatar
  • 31
1 vote
0 answers
357 views

I want to switch the payment gateway based on the user's request. I don't want multiple endpoints for each gateway, so i'm trying write one endpoint that handles multiple payment gateways. With that, ...
Chris's user avatar
  • 5,093
0 votes
2 answers
2k views

I have the following routes in routes/api.php: Route::get('items/{item}', function(Guid $item) {...}); Route::get('users/{user}', function(Guid $user) {...}); Since Guid is a custom type, how can I ...
shaedrich's user avatar
  • 5,763
0 votes
1 answer
321 views

I'm attempting to store an instance of the current department in Laravels Service Container, however sometimes this department may be null. The department itself is loaded from session and retrieved ...
Sheph's user avatar
  • 675
9 votes
2 answers
20k views

Need to understand Laravel service container and service provider through an example.
Ravinesh's user avatar
  • 125
1 vote
1 answer
859 views

I read this documentation about Service Container and also some other information on youtube but still not fully understand what is Service Container and how or when to use it so please if you can ...
zac's user avatar
  • 5,028
3 votes
1 answer
3k views

In Laravel to access query, we use DB facades DB::select() from alanstorm website http://alanstorm.com/binding_objects_as_laravel_services I learned that DB facade use callstatic method that lead to ...
Jsnow's user avatar
  • 375