Most viewed questions in Laravel

0 votes
1 answer

How to create a laravel hashed password?

Hii @kartik, Hashing A Password Using Bcrypt in Laravel: $password ...READ MORE

Aug 4, 2020 in Laravel by Niroj
• 82,880 points
4,097 views
0 votes
1 answer

Error:Node MODULE_NOT_FOUND

Hello @kartik, run rm -rf /usr/local/lib/node_modules/npm and then re-install ...READ MORE

Sep 25, 2020 in Laravel by Niroj
• 82,880 points
4,072 views
0 votes
1 answer

How to make Laravel (Blade) text field read only?

Just add it as the 3rd argument: {{ ...READ MORE

Dec 3, 2020 in Laravel by Niroj
• 82,880 points
4,030 views
0 votes
1 answer

How can I find the current language in a Laravel view?

Hello @kartik, The cleanest way to know the ...READ MORE

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

How can I change variables in the .env file dynamically in Laravel?

Hii, You can created the function below: public static ...READ MORE

Dec 4, 2020 in Laravel by Niroj
• 82,880 points
3,969 views
0 votes
1 answer

Error:Swift_TransportException Expected response code 220 but got code "", with message ""

Hello @kartik, This problem can generally occur when ...READ MORE

Jul 30, 2020 in Laravel by Niroj
• 82,880 points
3,961 views
0 votes
1 answer

How to display errors on laravel?

Hello @kartik, I had a problem with the ...READ MORE

Sep 24, 2020 in Laravel by Niroj
• 82,880 points
3,946 views
0 votes
1 answer

.How to turn off CSRF protection for a particular route in Laravel?

Hey, We can add that particular URL or ...READ MORE

Mar 24, 2020 in Laravel by Niroj
• 82,880 points
3,934 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,880 points
3,903 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,880 points
3,885 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,880 points
3,865 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,880 points
3,855 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,880 points
3,819 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,880 points
3,792 views
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,880 points
3,766 views
0 votes
1 answer

How to Install Laravel without using Composer?

Hello @kartik, If you really wanted to, you ...READ MORE

Aug 10, 2020 in Laravel by Niroj
• 82,880 points
3,758 views
0 votes
1 answer

How to check if a cookie is set in laravel?

Hello @kartik, You can change: @if (Cookie::get('cookiename') !== false) to @if ...READ MORE

Dec 7, 2020 in Laravel by Niroj
• 82,880 points
3,697 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,880 points
3,695 views
0 votes
1 answer

How to run specific migration in laravel?

Hello @kartik, Use this command: php artisan migrate --path=/database/migrations/my_migration.php  And ...READ MORE

Aug 10, 2020 in Laravel by Niroj
• 82,880 points
3,691 views
0 votes
1 answer

How can I modify a migration in Laravel?

Hello @kartik, You should create a new migration ...READ MORE

Sep 28, 2020 in Laravel by Niroj
• 82,880 points
3,681 views
0 votes
1 answer

How to make a constant and use globally in laravel?

Hii, You can create a constants.php page in config folder ...READ MORE

Mar 24, 2020 in Laravel by Niroj
• 82,880 points
3,672 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,880 points
3,589 views
0 votes
1 answer

How can I obtain a list of all files in a public folder in laravel?

You could create another disk for Storage ...READ MORE

Dec 8, 2020 in Laravel by Niroj
• 82,880 points
3,575 views
0 votes
1 answer

How to enable or disable maintenance mode in Laravel?

Hii, We have to use the following artisan ...READ MORE

Mar 24, 2020 in Laravel by Niroj
• 82,880 points
3,551 views
0 votes
1 answer

Laravel Pagination links not including other GET parameters

Hello @kartik, I think you should use this ...READ MORE

Aug 4, 2020 in Laravel by Niroj
• 82,880 points
3,516 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,880 points
3,500 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,880 points
3,460 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,880 points
3,438 views
0 votes
1 answer

How can I create a unique random string in laravel?

Hello @kartik, You can use : sha1(time()) Explanation: sha1 is ...READ MORE

Sep 25, 2020 in Laravel by Niroj
• 82,880 points
3,368 views
0 votes
1 answer

How to get a list of registered route paths in Laravel?

Hello, Route::getRoutes() returns a RouteCollection. On each element, you can ...READ MORE

Mar 31, 2020 in Laravel by Niroj
• 82,880 points
3,336 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,880 points
3,262 views
0 votes
1 answer

Error:Object of class Illuminate\Database\MySqlConnection could not be converted to string

Hello @kartik, The use keyword is what you need: $id = ...READ MORE

Sep 24, 2020 in Laravel by Niroj
• 82,880 points
3,260 views
0 votes
1 answer

Error: reverting ./composer.json to its original content

Hello @kartik, I used to use this: composer require ...READ MORE

Sep 11, 2020 in Laravel by Niroj
• 82,880 points
3,221 views
0 votes
1 answer

How to sync props to state using React hooks : setState()?

Hello @kartik, useState hooks function argument is being used ...READ MORE

Jun 1, 2020 in Laravel by Niroj
• 82,880 points
3,194 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,880 points
3,172 views
0 votes
1 answer

How to show all the variables as proper currency format in laravel?

Hello, You could create a custom Laravel directive. You ...READ MORE

Nov 2, 2020 in Laravel by Niroj
• 82,880 points
3,064 views
0 votes
1 answer

What is the difference between Facades and Dependency Injection in Laravel?

Hello, The main differnece between them is explained ...READ MORE

Mar 26, 2020 in Laravel by Niroj
• 82,880 points
3,056 views
0 votes
1 answer

How do I set laravel test to go to site name instead of localhost?

Hii, For Laravel 5, In the tests directory there should ...READ MORE

Nov 2, 2020 in Laravel by Niroj
• 82,880 points
3,042 views
0 votes
1 answer

Error: Class 'SoapClient' not found in /home/user/mysite.com/path/to/file.php on line 16

Hello @kartik, find this line in php.ini : ;extension=soap then ...READ MORE

Oct 29, 2020 in Laravel by Niroj
• 82,880 points
3,012 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,880 points
2,978 views
0 votes
1 answer

How to get data from Laravel backend and display in Vue/Nuxt frontend

Hello, You have to use the package dotenv. Then ...READ MORE

Apr 8, 2020 in Laravel by Niroj
• 82,880 points
2,919 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,880 points
2,875 views
0 votes
1 answer

How to identify wheather the request is HTTP GET or HTTP POST in Laravel?

Hey, In order to identify the type of ...READ MORE

Mar 19, 2020 in Laravel by Niroj
• 82,880 points
2,868 views
0 votes
1 answer

How to test POST routes in Laravel?

Hello @kartik, You could try this: public function testStoreAction() { ...READ MORE

Oct 21, 2020 in Laravel by Niroj
• 82,880 points
2,867 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,880 points
2,840 views
0 votes
1 answer

Error:“The page has expired due to inactivity” - Laravel 5.5

Hello @kartik, Make sure you have already added ...READ MORE

Aug 4, 2020 in Laravel by Niroj
• 82,880 points
2,805 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,880 points
2,804 views
0 votes
1 answer

How to refer laravel csrf field inside a vue template?

Hello @kartik, If you have the token in ...READ MORE

Oct 21, 2020 in Laravel by Niroj
• 82,880 points
2,758 views
0 votes
1 answer

Laravel 5.1 date_format validation allow two formats

Hello @kartik, The date_format validator takes only one date format ...READ MORE

Sep 30, 2020 in Laravel by Niroj
• 82,880 points
2,757 views
0 votes
1 answer

How to populating a database in a Laravel migration file?

Hello @kartik, Don't put the DB::insert() inside of ...READ MORE

Aug 4, 2020 in Laravel by Niroj
• 82,880 points
2,750 views