Trending questions in Laravel

0 votes
1 answer

Error:Relationship method must return an object of type Illuminate\Database\Eloquent\Relations\Relation

Hello @kartik, When you try to access a ...READ MORE

Dec 1, 2020 in Laravel by Niroj
• 82,840 points
4,148 views
0 votes
1 answer

How to make auto login after registration in laravel?

Hello, You can try to login the user ...READ MORE

Nov 2, 2020 in Laravel by Niroj
• 82,840 points
5,369 views
0 votes
1 answer

How to remove Parameter From All Request Objects at Controller Level?

Hello @kartik, First arrange for the middleware to ...READ MORE

Oct 21, 2020 in Laravel by Niroj
• 82,840 points
5,809 views
0 votes
1 answer

Laravel Eloquent Query Builder Default Where Condition

Hello, normally override newQuery() for this. newQuery() is the method that Eloquent ...READ MORE

Dec 3, 2020 in Laravel by Niroj
• 82,840 points
3,898 views
0 votes
1 answer

Error:file_put_contents(): Exclusive locks are not supported for this stream

Hello, After update do: chmod -R gu+w storage chmod -R ...READ MORE

Dec 1, 2020 in Laravel by Niroj
• 82,840 points
3,845 views
0 votes
1 answer

How throw forbidden exception from middleware in laravel5?

Hello @kartik, You can simply use the abort() helper. (Or App::abort()) public ...READ MORE

Oct 23, 2020 in Laravel by Niroj
• 82,840 points
5,469 views
0 votes
1 answer

How to check if a user email already exist?

Hello @kartik, The validation feature built into Laravel ...READ MORE

Dec 7, 2020 in Laravel by Niroj
• 82,840 points
3,515 views
0 votes
1 answer

How Laravel Eloquent Model Attributes maps to the table?

Hello @kartik, If your model is filled with ...READ MORE

Dec 1, 2020 in Laravel by Niroj
• 82,840 points
3,693 views
0 votes
1 answer

How to compare two encrypted(bcrypt) password in laravel?

Hello @kartik, You can simply use Hash::check() method eg: if(Hash::check('plain-text', $hashedPassword)) ...READ MORE

Oct 21, 2020 in Laravel by Niroj
• 82,840 points
5,355 views
0 votes
1 answer

How to match input password and database hash password in laravel?

Hello @kartik, First, you'll need to find the ...READ MORE

Sep 30, 2020 in Laravel by Niroj
• 82,840 points
6,188 views
0 votes
1 answer

How to use withErrors with Exception error messages in Laravel?

Hello @kartik, Try this: return Redirect::to('admin/users/create') ...READ MORE

Oct 28, 2020 in Laravel by Niroj
• 82,840 points
4,835 views
0 votes
1 answer

Error : Call to undefined method Illuminate\Http\Request::put()

Hello, You need to customize the request $data = ...READ MORE

Nov 11, 2020 in Laravel by Niroj
• 82,840 points
4,191 views
0 votes
1 answer

How to configure Laravel mail.php to use built-in mail function?

Hello, To do the same as mail() PHP ...READ MORE

Dec 3, 2020 in Laravel by Niroj
• 82,840 points
3,223 views
0 votes
1 answer

How to asynchronous shell exec in PHP?

Hello @kartik, good way to run an asynchronous ...READ MORE

Sep 29, 2020 in Laravel by Niroj
• 82,840 points
6,010 views
0 votes
1 answer

How do I get raw form data in laravel?

Hii @kartik, Laravel intercepts all input. If you're ...READ MORE

Oct 28, 2020 in Laravel by Niroj
• 82,840 points
4,702 views
0 votes
1 answer

How to get the id when you're validating in the model Validation unique on update using laravel?

Hello @kartik, in Laravel's inbuilt auth system, the ...READ MORE

Sep 11, 2020 in Laravel by Niroj
• 82,840 points
6,713 views
0 votes
1 answer

How to invalidate all tokens for an user in laravel passport?

Hello @kartik, One of the methods it provides ...READ MORE

Oct 23, 2020 in Laravel by Niroj
• 82,840 points
4,877 views
0 votes
1 answer

How to Get the Current URL Inside @if Statement in Laravel?

Hello @kartik, You can use: Request::url() to obtain the current ...READ MORE

Nov 11, 2020 in Laravel by Niroj
• 82,840 points
4,002 views
0 votes
1 answer

How can I pass parameter from Route to Filter in laravel?

Hii, Filters can be passed parameters, like the ...READ MORE

Dec 4, 2020 in Laravel by Niroj
• 82,840 points
2,992 views
0 votes
1 answer

Error:Symfony\Component\Debug\Exception\FatalErrorException] syntax error, unexpected ',', expecting variable (T_VARIABLE)

Hii, Try this command: php -S localhost:8000 -t public Then ...READ MORE

Dec 4, 2020 in Laravel by Niroj
• 82,840 points
2,985 views
0 votes
1 answer

How to break a for each loop in laravel blade view?

Hello @kartik, By default, blade doesn't have @break and @continue which are ...READ MORE

Apr 6, 2020 in Laravel by Niroj
• 82,840 points
13,406 views
0 votes
1 answer

How to get the server IP with Laravel?

Hello @kartik, You can use request object: request()->server('SERVER_ADDR'); Or you ...READ MORE

Nov 2, 2020 in Laravel by Niroj
• 82,840 points
4,322 views
0 votes
1 answer

Error: Can't get session in controller constructor

Hello @kartik, You can't do it by default ...READ MORE

Dec 2, 2020 in Laravel by Niroj
• 82,840 points
3,000 views
0 votes
1 answer

Error:Loading composer repositories with package information Updating dependencies (including require-dev) Killed

Hello @kartik, The "Killed" message usually means your ...READ MORE

Aug 4, 2020 in Laravel by Niroj
• 82,840 points
8,124 views
0 votes
1 answer

How do I include partials from a blade layout in laravel?

Hello @kartik, You need to give the full ...READ MORE

Nov 2, 2020 in Laravel by Niroj
• 82,840 points
4,179 views
0 votes
1 answer

How to create migration from existing database in laravel?

Hello @kartik,  Laravel migration generator for your existing ...READ MORE

Dec 7, 2020 in Laravel by Niroj
• 82,840 points
2,672 views
0 votes
1 answer

How to use API Routes in Laravel?

Hello @kartik, You call it by http://localhost:8080/api/test ...READ MORE

Aug 10, 2020 in Laravel by Niroj
• 82,840 points
7,803 views
0 votes
1 answer

Error:The Response content must be a string or object implementing __toString(), "boolean" given.

Hello @kartik, Your response must return some sort ...READ MORE

Sep 24, 2020 in Laravel by Niroj
• 82,840 points
5,827 views
0 votes
1 answer

How to validate exact words in Laravel?

Hello, Try this code: // option one: 'in' takes ...READ MORE

Dec 4, 2020 in Laravel by Niroj
• 82,840 points
2,650 views
0 votes
1 answer

How do you check if a field is not null with Eloquent?

Hello @kartik, Simply,we can use Model::whereNotNull('sent_at'); Or Model::whereRaw('sent_at is not null'); Thank ...READ MORE

Nov 11, 2020 in Laravel by Niroj
• 82,840 points
3,628 views
0 votes
1 answer

How can I access my Laravel app from another PC?

Hello @kartik, Use: sudo php artisan serve --host 192.168.1.101 ...READ MORE

Oct 23, 2020 in Laravel by Niroj
• 82,840 points
4,442 views
0 votes
1 answer

Why to use DB::raw inside DB::select in Laravel?

Hello @kartik, DB::raw() is used to make arbitrary SQL ...READ MORE

Oct 28, 2020 in Laravel by Niroj
• 82,840 points
4,220 views
0 votes
1 answer

How do you wrap Laravel Eloquent ORM query scopes in parentheses when chaining?

Hello @kartik, You can generate parentheses by passing ...READ MORE

Dec 2, 2020 in Laravel by Niroj
• 82,840 points
2,717 views
0 votes
1 answer

How do I write to the console from a Laravel Controller?

Hello @kartik, This can be done with the ...READ MORE

Aug 11, 2020 in Laravel by Niroj
• 82,840 points
7,441 views
0 votes
1 answer

How laravel Lumen Ensure JSON response?

Hello @kartik, You'll need to adjust your exception ...READ MORE

Dec 2, 2020 in Laravel by Niroj
• 82,840 points
2,520 views
0 votes
1 answer

How to pass data to mail View in laravel Mail send?

Hello @kartik, Send data like this. $data = [ ...READ MORE

Jul 30, 2020 in Laravel by Niroj
• 82,840 points
7,901 views
0 votes
1 answer

How to chunk results from a custom query in Laravel

Hello @kartik, Try something like this: <?php $max = 100; $total ...READ MORE

Dec 7, 2020 in Laravel by Niroj
• 82,840 points
2,279 views
0 votes
1 answer

How to delete queued jobs in laravel?

Hello @kartik, Restart Beanstalk: sudo service beanstalkd restart ...READ MORE

Dec 2, 2020 in Laravel by Niroj
• 82,840 points
2,456 views
0 votes
1 answer

How to get response from Artisan call?

Hello @kartik,  You can simply use: Artisan::output() READ MORE

Dec 2, 2020 in Laravel by Niroj
• 82,840 points
2,341 views
0 votes
1 answer

How to order results of related models in laravel eloquent?

Hello @kartik, You have a few ways of ...READ MORE

Dec 8, 2020 in Laravel by Niroj
• 82,840 points
2,063 views
0 votes
1 answer

How to Select Certain Fields in Laravel Eloquent?

Hello @kartik, lists() turns the resulting collection into an ...READ MORE

Oct 21, 2020 in Laravel by Niroj
• 82,840 points
4,164 views
0 votes
1 answer

How do I insert user into mysql table from within Laravel?

Hello @kartik, First Create seeder with artisan: php artisan make:seeder ...READ MORE

Nov 12, 2020 in Laravel by Niroj
• 82,840 points
3,146 views
0 votes
1 answer

How to add new value in collection laravel?

Hello @kartik, If you have a collection you ...READ MORE

Dec 4, 2020 in Laravel by Niroj
• 82,840 points
2,158 views
0 votes
1 answer

How To Cast Eloquent Pivot Parameters?

Hello, In Laravel 5.1 or higher you can ...READ MORE

Nov 12, 2020 in Laravel by Niroj
• 82,840 points
3,103 views
0 votes
1 answer

How to post the values into validation and return the response as json rather than return view in laravel blade?

Hii, You can also tell Laravel you want ...READ MORE

Nov 12, 2020 in Laravel by Niroj
• 82,840 points
3,076 views
0 votes
1 answer

In an Laravelcollective submit button how to add icon?

Hello @kartik, Try to use Form::button instead of ...READ MORE

Dec 4, 2020 in Laravel by Niroj
• 82,840 points
2,086 views
0 votes
1 answer

How to check request is ajax or not in Laravel?

Hello, Laravel allow use of their library method that ...READ MORE

Mar 23, 2020 in Laravel by Niroj
• 82,840 points
13,131 views
0 votes
1 answer

How to give custom field name in laravel form validation error message?

Hello @kartik, You can specify custom error message ...READ MORE

Sep 30, 2020 in Laravel by Niroj
• 82,840 points
4,865 views
0 votes
1 answer

How do you add headers to a response with a middleware?

Hello @kartik, Using the response helper. use Illuminate\Http\RedirectResponse; $response = $next($request); $response = ...READ MORE

Oct 28, 2020 in Laravel by Niroj
• 82,840 points
3,627 views
0 votes
1 answer

How to use paginate() with a having() clause when column does not exist in table

Hello @kartik, You can calculate the distance in ...READ MORE

Dec 2, 2020 in Laravel by Niroj
• 82,840 points
2,074 views