Trending questions in Laravel

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,012 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,192 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,617 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,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,880 points
2,949 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,306 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,283 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,869 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,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,880 points
4,890 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,059 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,661 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,672 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,079 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
960 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,088 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,044 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,493 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,790 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,873 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
836 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,719 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
884 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
851 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
11,996 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
704 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,616 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,160 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
774 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,867 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,511 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
1,992 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
567 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
514 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,198 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,943 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,302 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,832 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,184 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,438 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,178 views
0 votes
1 answer
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,669 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,880 points
978 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,694 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
9,989 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,634 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,574 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
666 views