Trending questions in Laravel

0 votes
1 answer

How to set .env values in laravel programmatically on the fly?

Hello @kartik, Since Laravel uses config files to ...READ MORE

Sep 24, 2020 in Laravel by Niroj
• 82,840 points
4,979 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,840 points
3,309 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,840 points
4,803 views
0 votes
1 answer

How to delete a single record in Laravel 5?

Hello @kartik, Delete an existing Model $user = User::find(1); $user->delete(); Deleting ...READ MORE

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

Error: laravel.log could not be opened?

Hello, Never use 777 for directories on your ...READ MORE

Apr 2, 2020 in Laravel by Niroj
• 82,840 points
12,409 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,840 points
3,385 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,840 points
3,238 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,840 points
4,637 views
0 votes
1 answer

How to make a new page with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

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

Error:Laravel PHP Command Not Found

Hello @kartik, Try the follwing snippet: nano ~/.bash_profile And ...READ MORE

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

Error:Class 'App\Http\Controllers\Model' not found

Hello @kartik, You need to import your model ...READ MORE

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

How to create and Update Laravel Eloquent?

Hello @kartik, There has been a couple of ...READ MORE

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

TypeError: process.getuid is not a function”

Hello @kartik, Simply running npm install solved it for ...READ MORE

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

How can I create a migration to add a value to an enum in eloquent?

Hello @kartik, Try using this code: public function up() ...READ MORE

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

Error:Laravel 5 show ErrorException file_put_contents failed to open stream: No such file or directory

Hello @kartik, The best way to solve this ...READ MORE

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

How Can I Set the Default Value of a Timestamp Column to the Current Timestamp with Laravel Migrations?

Hello, To create both of the created_at and updated_at columns: $t->timestamp('created_at')->default(DB::raw('CURRENT_TIMESTAMP')); $t->timestamp('updated_at')->default(DB::raw('CURRENT_TIMESTAMP on update ...READ MORE

Apr 2, 2020 in Laravel by Niroj
• 82,840 points
12,097 views
0 votes
1 answer

How to have one-time push in laravel blade?

Hii @kartik,  Extend Blade by creating a push once directive as ...READ MORE

Oct 28, 2020 in Laravel by Niroj
• 82,840 points
2,987 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,840 points
4,213 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

Sep 24, 2020 in Laravel by Niroj
• 82,840 points
4,342 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,840 points
4,330 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,840 points
3,158 views
0 votes
1 answer

How to insert raw data in mysql database in laravel?

Try this: Suppose you have the following tables ...READ MORE

Dec 7, 2020 in Laravel by Niroj
• 82,840 points
1,123 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,840 points
4,200 views
0 votes
1 answer

How can I define a route differently if parameter is not integer?

Hello @kartik, Just add ->where('id', '[0-9]+') to route where you ...READ MORE

Dec 1, 2020 in Laravel by Niroj
• 82,840 points
1,207 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,840 points
2,961 views
0 votes
1 answer

How to make Django serve that file for download as opposed to trying to find a URL and View to display it?

Hello @kartik, You can just use the built ...READ MORE

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

How to rename the "label" to "Resource Test"?

Hello, You can override the static label method ...READ MORE

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

How to delete confirmation in laravel?

Hello @kartik, If this is your link: <a href="#" ...READ MORE

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

Error:return \Redirect::route('regions')->with('message', 'State saved correctly!!!');

Hello @kartik, You can pass the route parameters ...READ MORE

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

How to simplify this Laravel PHP code to one Eloquent query?

Hello @kartik, You create realtionship between both table friend and user in ...READ MORE

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

How can I store and retrieve images from a MySQL database using PHP?

Hello @kartik, First you create a MySQL table ...READ MORE

Oct 29, 2020 in Laravel by Niroj
• 82,840 points
2,347 views
0 votes
1 answer

How to execute Stored Procedure from Laravel?

Hello @kartik, You can try something like this DB::select('exec ...READ MORE

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

How to get view data during unit testing in Laravel?

Hii, Try this: $response->getSession()->get("errors") And from there you can check ...READ MORE

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

How can I implement single table inheritance using Laravel's Eloquent?

Hello @kartik, Global Scope is available: class Article extends Post { ...READ MORE

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

How to run laravel 5.0 project on localhost without use php artisan serve?

Hello @kartik, You need to change "server.php" to ...READ MORE

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

How to pass data through URL and access through controller in Laravel?

Hello, You can  first refer how to  Create controller through ...READ MORE

Mar 18, 2020 in Laravel by Niroj
• 82,840 points
11,902 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,840 points
3,640 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,840 points
3,690 views
0 votes
1 answer

How to “Refresh” the User object in Laravel?

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

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

How and where can store images with laravel?

Hello, Make directory for images in myapp/public/images and ...READ MORE

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

How can I clear the cache in laravel using command line?

Hello @kartik, cache:clear artisan command does calls flush function on current ...READ MORE

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

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

Hii, You can simply use: $new_collection = $collection->merge($other_collection). Hope it ...READ MORE

Nov 12, 2020 in Laravel by Niroj
• 82,840 points
1,423 views
0 votes
1 answer
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,840 points
3,112 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,840 points
3,122 views
0 votes
1 answer

Error:“Uncaught SyntaxError: Identifier 'Common' has already been declared after making javascript class object” in console?

Hello, You can write like this, you need ...READ MORE

Apr 14, 2020 in Laravel by Niroj
• 82,840 points
10,352 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,840 points
3,001 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,840 points
2,982 views
0 votes
1 answer

Error:Laravel requires the Mcrypt PHP extension.

Hello, Use which php in the terminal to see which ...READ MORE

Nov 11, 2020 in Laravel by Niroj
• 82,840 points
1,136 views