Trending questions in Laravel

+1 vote
2 answers

How to access images inside public folder in laravel?

You simply need to use the asset helper function ...READ MORE

Aug 27 in Laravel by Dsouza
• 150 points
8,079 views
+5 votes
1 answer

Error:Uncaught ReferenceError: is not defined at HTMLAnchorElement.onclick

Hello, With my limited understanding, I tried to ...READ MORE

Apr 14 in Laravel by Niroj
• 59,780 points
10,129 views
+3 votes
2 answers

Error - 419 Sorry, your session has expired.Post request in Laravel?

Sometimes the cache can also lead to ...READ MORE

Aug 28 in Laravel by Ishita
• 150 points
7,326 views
+1 vote
1 answer

How to add a new column to existing table of laravel in a migration?

Hii @kartik, To create a migration, you may ...READ MORE

Mar 30 in Laravel by Niroj
• 59,780 points
10,587 views
0 votes
4 answers

How to get user's IP address in Laravel?

Use $clientIP = request()->ip(); READ MORE

Sep 21 in Laravel by aakash
• 210 points
5,702 views
+1 vote
2 answers

Error: Exception file_put_contents failed to open stream: No such file or directory in Laravel?

Hello, You should typically run the php artisan config:cache command ...READ MORE

Mar 31 in Laravel by Niroj
• 59,780 points
4,376 views
0 votes
1 answer

How to Decode Json object in laravel and apply foreach loop on that in laravel?

Hello @kartik, you can use json_decode function foreach (json_decode($response) as $area) { ...READ MORE

7 hours ago in Laravel by Niroj
• 59,780 points
17 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

7 hours ago in Laravel by Niroj
• 59,780 points
14 views
0 votes
1 answer

How to perform a delete operation on a Model?

Hello @kartik, You can put this code for ...READ MORE

8 hours ago in Laravel by Niroj
• 59,780 points
7 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

9 hours ago in Laravel by Niroj
• 59,780 points
7 views
0 votes
1 answer

How to show old data of dynamic checkbox in Laravel?

Hello @kartik, This will work: ...READ MORE

9 hours ago in Laravel by Niroj
• 59,780 points
7 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

11 hours ago in Laravel by Niroj
• 59,780 points
9 views
0 votes
1 answer

The stream or file "/var/www/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied

Hello @kartik, Make your Dockerfile something as below ...READ MORE

10 hours ago in Laravel by Niroj
• 59,780 points
6 views
0 votes
1 answer

How to “Refresh” the User object in Laravel?

Hello @kartik, You can update the cache object ...READ MORE

10 hours ago in Laravel by Niroj
• 59,780 points
4 views
0 votes
1 answer

How to select year and month from the created_at attributes of database table in laravel 5.1?

Hello @kartik, There are date helpers available in ...READ MORE

11 hours ago in Laravel by Niroj
• 59,780 points
5 views
0 votes
1 answer

How can we allow the funtion to have access to $slug?

Hello @kartik, You have to use use to pass variables ...READ MORE

11 hours ago in Laravel by Niroj
• 59,780 points
3 views
0 votes
1 answer

How to convert a UNIX Timestamp to Formatted Date String?

Hello @kartik, Try gmdate like this: <?php $timestamp=1333699439; echo gmdate("Y-m-d\TH:i:s\Z", $timestamp); ?> Hope it helps!! Thank ...READ MORE

1 day ago in Laravel by Niroj
• 59,780 points
13 views
0 votes
1 answer

How to detect a mobile device in PHP?

Hello @kartik, Here is the code: <?php $useragent=$_SERVER['HTTP_USER_AGENT']; if(preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( ...READ MORE

1 day ago in Laravel by Niroj
• 59,780 points
9 views
0 votes
1 answer

How to generating a random password in php?

Hello @kartik, Try this (use strlen instead of count, because count on a ...READ MORE

1 day ago in Laravel by Niroj
• 59,780 points
9 views
0 votes
1 answer

How to asynchronous shell exec in PHP?

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

1 day ago in Laravel by Niroj
• 59,780 points
10 views
0 votes
1 answer

How can I use Guzzle to send a POST request in JSON?

Hello @kartik, For Guzzle 5, 6 and 7 you do ...READ MORE

1 day ago in Laravel by Niroj
• 59,780 points
5 views
0 votes
1 answer

How to pass variable to next page using php?

Hello @kartik, You can add the variable in ...READ MORE

1 day ago in Laravel by Niroj
• 59,780 points
7 views
0 votes
1 answer

How to get a variable name as a string in PHP?

Hello @kartik, You can use this: function varName( $v ...READ MORE

1 day ago in Laravel by Niroj
• 59,780 points
7 views
0 votes
1 answer

How to unzip a file with php?

Hello @kartik. PHP has built-in extensions for dealing ...READ MORE

1 day ago in Laravel by Niroj
• 59,780 points
6 views
0 votes
1 answer

How to remove the querystring and get only the url?

Hello @kartik, ou can use strtok to get string before ...READ MORE

1 day ago in Laravel by Niroj
• 59,780 points
6 views
0 votes
1 answer

How to getting the location from an IP address?

Hello @kartik, You could download a free GeoIP ...READ MORE

1 day ago in Laravel by Niroj
• 59,780 points
5 views
0 votes
1 answer

Error: Class 'TestCase' not found in D:\xampp\htdocs\laravel\app\tests\ExampleTest.php on line 3 ,

Hello @kartik, Run following command in your project's ...READ MORE

3 days ago in Laravel by Niroj
• 59,780 points
42 views
0 votes
1 answer

How can I build a condition based query in Laravel?

Hello @kartik, Try this: $query = DB::table('node'); if ($published == ...READ MORE

3 days ago in Laravel by Niroj
• 59,780 points
38 views
0 votes
1 answer

How to run migrations on another database in laravel?

Hello @kartik, If you place database config on ...READ MORE

3 days ago in Laravel by Niroj
• 59,780 points
30 views
0 votes
1 answer

How to check if connected to database in Laravel?

Hello @kartik, You can use if(DB::connection()->getDatabaseName()) { echo ...READ MORE

3 days ago in Laravel by Niroj
• 59,780 points
16 views
0 votes
1 answer

How can I modify a migration in Laravel?

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

3 days ago in Laravel by Niroj
• 59,780 points
17 views
0 votes
1 answer

How to get route action name in laravel?

Hello @kartik, To get action name, you need ...READ MORE

3 days ago in Laravel by Niroj
• 59,780 points
15 views
0 votes
1 answer

Using Artisan::call() to pass non-option arguments

Hello @kartik, Use: Artisan::call('db:migrate', ['' => 'mymigration', '--table' => ...READ MORE

3 days ago in Laravel by Niroj
• 59,780 points
14 views
0 votes
1 answer

How to revert 'php artisan serve' command in laravel

Hello @kartik, Press Ctrl + Shift + ESC. Locate the php process running ...READ MORE

3 days ago in Laravel by Niroj
• 59,780 points
14 views
0 votes
1 answer

How to upload files in Laravel directly into public folder?

Hello @kartik, You can create a new storage ...READ MORE

3 days ago in Laravel by Niroj
• 59,780 points
15 views
0 votes
1 answer

How to delete file from public folder in laravel?

Hello @kartik, You could use PHP's unlink() method ...READ MORE

3 days ago in Laravel by Niroj
• 59,780 points
10 views
0 votes
1 answer
0 votes
1 answer

How to validate an input field if value is not null in Laravel?

Hello @kartik, try using nullable as a rule 'password' ...READ MORE

5 days ago in Laravel by Niroj
• 59,780 points
28 views
0 votes
1 answer

How could i create carbon object from given datetime structure?

Hello @kartik, Use Carbon::parse('2020-09-25 14:26');, it will return a Carbon object. Hope it ...READ MORE

5 days ago in Laravel by Niroj
• 59,780 points
32 views
0 votes
1 answer

How to call a controller function inside a view in laravel 5

Hello @kartik, Just try this in your view ...READ MORE

5 days ago in Laravel by Niroj
• 59,780 points
26 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

5 days ago in Laravel by Niroj
• 59,780 points
17 views
0 votes
1 answer

How change view folder in Laravel5?

Hello @kartik, See line 16 of config/view.php (the "View Storage ...READ MORE

5 days ago in Laravel by Niroj
• 59,780 points
15 views
0 votes
1 answer

How to use GROUP_CONCAT in laravel?

Hello @kartik, You can use relations as query ...READ MORE

5 days ago in Laravel by Niroj
• 59,780 points
11 views
0 votes
1 answer

How to validate Route Parameters in Laravel?

Hello @kartik, The issue is route parameters aren't ...READ MORE

5 days ago in Laravel by Niroj
• 59,780 points
17 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

5 days ago in Laravel by Niroj
• 59,780 points
13 views
0 votes
1 answer

Error:ErrorException in Filesystem.php

Hello @kartik, Try this: chmod -R gu+w storage chmod -R ...READ MORE

5 days ago in Laravel by Niroj
• 59,780 points
11 views
0 votes
1 answer

How to display errors on laravel?

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

6 days ago in Laravel by Niroj
• 59,780 points
31 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

6 days ago in Laravel by Niroj
• 59,780 points
23 views
0 votes
1 answer

How to update a pivot table using Eloquent in laravel 5?

Hello @kartik, The code below solved my problem: $messages ...READ MORE

6 days ago in Laravel by Niroj
• 59,780 points
16 views