Trending questions in Laravel

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,880 points
1,723 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,034 views
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,880 points
4,655 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,384 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,000 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,880 points
2,435 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,880 points
11,923 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,880 points
1,178 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,880 points
2,305 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,880 points
4,945 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,111 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,880 points
6,698 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,880 points
6,112 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,880 points
2,702 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,880 points
982 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,880 points
4,140 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,062 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,849 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,880 points
11,542 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,936 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,880 points
12,148 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,750 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,880 points
848 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,880 points
925 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,667 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,880 points
862 views
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,880 points
724 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,880 points
6,196 views
0 votes
1 answer
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,880 points
795 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,880 points
11,679 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,880 points
1,912 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,880 points
2,028 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,880 points
586 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,880 points
528 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,880 points
2,229 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,880 points
1,962 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,342 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,880 points
1,863 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,880 points
1,214 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,880 points
11,490 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,880 points
10,755 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,240 views
0 votes
1 answer
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,880 points
995 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,740 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,880 points
10,032 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,688 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,620 views
0 votes
1 answer

How to get the Last Inserted Id Using Laravel Eloquent?

Hello @kartik, Firstly create an object, Then set ...READ MORE

Nov 11, 2020 in Laravel by Niroj
• 82,880 points
703 views