Latest questions in Laravel

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,731 views
0 votes
1 answer

How to gett selected values from a multiple select form in Laravel?

Hello @kartik, First, if you want to have ...READ MORE

Oct 21, 2020 in Laravel by Niroj
• 82,880 points
6,909 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,880 points
5,365 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,806 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,880 points
4,962 views
0 votes
1 answer

How to include csrf_token() in an external js file in Laravel?

Hello @kartik, add <meta> tag with the token to the ...READ MORE

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

How to use patch request in Laravel?

Hello @kartik, Your route is: Route::patch('users/update', 'UsersController@update'); replace your route ...READ MORE

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

How to remove composer sdk from laravel packages

Use  two blade page,one for create and other ...READ MORE

Oct 15, 2020 in Laravel by Niroj
• 82,880 points
1,188 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,880 points
5,648 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

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

How to perform a delete operation on a Model?

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

Sep 30, 2020 in Laravel by Niroj
• 82,880 points
352 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,880 points
4,424 views
0 votes
1 answer

How to show old data of dynamic checkbox in Laravel?

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

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

How to “Refresh” the User object in Laravel?

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

Sep 30, 2020 in Laravel by Niroj
• 82,880 points
2,328 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

Sep 30, 2020 in Laravel by Niroj
• 82,880 points
20,533 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

Sep 30, 2020 in Laravel by Niroj
• 82,880 points
510 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

Sep 30, 2020 in Laravel by Niroj
• 82,880 points
14,280 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,707 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

Sep 29, 2020 in Laravel by Niroj
• 82,880 points
11,301 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

Sep 29, 2020 in Laravel by Niroj
• 82,880 points
2,290 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

Sep 29, 2020 in Laravel by Niroj
• 82,880 points
2,647 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

Sep 29, 2020 in Laravel by Niroj
• 82,880 points
609 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,880 points
5,362 views
0 votes
2 answers

How to pass variable to next page using php?

Simply use Sessions my friend Page1: session_start(); $ ...READ MORE

Oct 6, 2020 in Laravel by anonymous
• 140 points
13,556 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

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

How to unzip a file with php?

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

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

How to getting the location from an IP address?

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

Sep 29, 2020 in Laravel by Niroj
• 82,880 points
1,224 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

Sep 29, 2020 in Laravel by Niroj
• 82,880 points
4,074 views
0 votes
2 answers

How to delete file from public folder in laravel?

I just want to add @niroj answer  Use ...READ MORE

Nov 5, 2020 in Laravel by Helloworld
• 140 points
26,287 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

Sep 28, 2020 in Laravel by Niroj
• 82,880 points
7,997 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

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

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

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

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

How to get route action name in laravel?

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

Sep 28, 2020 in Laravel by Niroj
• 82,880 points
4,332 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

Sep 28, 2020 in Laravel by Niroj
• 82,880 points
495 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

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

How to run migrations on another database in laravel?

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

Sep 28, 2020 in Laravel by Niroj
• 82,880 points
2,496 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,628 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

Sep 28, 2020 in Laravel by Niroj
• 82,880 points
9,202 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

Sep 25, 2020 in Laravel by Niroj
• 82,880 points
891 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,314 views
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

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

How to use GROUP_CONCAT in laravel?

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

Sep 25, 2020 in Laravel by Niroj
• 82,880 points
6,865 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

Sep 25, 2020 in Laravel by Niroj
• 82,880 points
1,322 views
0 votes
1 answer
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

Sep 25, 2020 in Laravel by Niroj
• 82,880 points
8,020 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,052 views
0 votes
1 answer

Error:ErrorException in Filesystem.php

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

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

How to validate Route Parameters in Laravel?

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

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

How to return database table name in Laravel?

Hello @kartik, There is a public getTable() method ...READ MORE

Sep 24, 2020 in Laravel by Niroj
• 82,880 points
2,674 views