Most viewed questions in Laravel

0 votes
1 answer

How to include a sub-view in Blade templates in Laravel?

Hello @kartik, You can use the blade template ...READ MORE

Mar 31, 2020 in Laravel by Niroj
• 82,880 points
14,573 views
0 votes
1 answer

Error:Variable 'sql_mode' can't be set to the value of 'NO_AUTO_CREATE_USER'

Hello @kartik, your laravel connexion (config / database.php) ...READ MORE

Dec 3, 2020 in Laravel by Niroj
• 82,880 points
14,482 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,284 views
0 votes
1 answer

How to exclude certains columns while using eloquent?

Hello @kartik, Using hidden array in model is good, but ...READ MORE

Aug 11, 2020 in Laravel by Niroj
• 82,880 points
14,034 views
0 votes
1 answer

How to Find User in Laravel by Username?

Hello, using the model. just like this User::where('username','John') -> ...READ MORE

Dec 3, 2020 in Laravel by Niroj
• 82,880 points
13,868 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,566 views
0 votes
1 answer

Error: The requested URL /login was not found on this server. Apache (Ubuntu) Server at mydomain.com Port 80

Hello @kartik,  your directory path is wrong. You ...READ MORE

Nov 12, 2020 in Laravel by Niroj
• 82,880 points
13,518 views
0 votes
1 answer

How Can I Remove “public/index.php” in the URL Generated Laravel?

Hello @kartik, If it isn't already there, create ...READ MORE

Aug 10, 2020 in Laravel by Niroj
• 82,880 points
12,920 views
0 votes
1 answer

How to do update query on laravel fluent using db::raw?

Hello @kartik, Code row updates like this: ...->update( array( ...READ MORE

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

How to break a for each loop in laravel blade view?

Hello @kartik, By default, blade doesn't have @break and @continue which are ...READ MORE

Apr 6, 2020 in Laravel by Niroj
• 82,880 points
12,780 views
0 votes
1 answer

How to manually run a laravel job using command line?

Hello, If you are using a QUEUE_DRIVER diferent to sync and you ...READ MORE

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

How to manually create a new empty Eloquent Collection in Laravel?

Hello @kartik, It's not really Eloquent, to add ...READ MORE

Aug 11, 2020 in Laravel by Niroj
• 82,880 points
12,375 views
0 votes
1 answer

How to Insert a value to hidden input Laravel Blade?

Hello @kartik, Usually, this is used in Blade ...READ MORE

Dec 1, 2020 in Laravel by Niroj
• 82,880 points
12,174 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,167 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,058 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,887 views
0 votes
1 answer

How to set session timeout in Laravel?

Hello, In app/config/session.php you have: lifetime option that allow you to set session ...READ MORE

Dec 1, 2020 in Laravel by Niroj
• 82,880 points
11,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,571 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,506 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,460 views
0 votes
1 answer

How to access Session variables and set them in javascript?

Hello @kartik, Assigning the ASP.NET Session Variable using ...READ MORE

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

Error:Laravel Migration table already exists but i want to add new not the older

Hello @kartik, You need to run php artisan migrate:rollback if ...READ MORE

Aug 11, 2020 in Laravel by Niroj
• 82,880 points
10,827 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,696 views
0 votes
1 answer

Error:sending email via php mail function goes to spam

Hello @kartik, Try changing your headers to this: $headers ...READ MORE

Jul 30, 2020 in Laravel by Niroj
• 82,880 points
10,559 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,530 views
0 votes
1 answer

What is the use of the Eloquent cursor() method in Laravel?

Hello, The cursor method allows us to iterate ...READ MORE

Mar 20, 2020 in Laravel by Niroj
• 82,880 points
10,322 views
0 votes
1 answer

What is reverse routing in Laravel?

 Laravel reverse routing is generating URL's based ...READ MORE

Mar 17, 2020 in Laravel by Niraj
10,060 views
0 votes
1 answer

How to alias a table in Laravel Eloquent queries using Query Builder?

Hello @kartik, You can use less code, writing ...READ MORE

Nov 11, 2020 in Laravel by Niroj
• 82,880 points
10,032 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,004 views
0 votes
1 answer

Error:Non-static method Illuminate\Http\Request::all() should not be called statically, assuming $this from incompatible context

Hello @kartik, The error message is due to ...READ MORE

Aug 4, 2020 in Laravel by Niroj
• 82,880 points
9,930 views
0 votes
1 answer

How To Pass GET Parameters To Laravel From With GET Method ?

Hello @kartik, The simplest way is just to ...READ MORE

Sep 24, 2020 in Laravel by Niroj
• 82,880 points
9,631 views
0 votes
1 answer

Required_if laravel with multiple value

You just have to pass all the ...READ MORE

Dec 8, 2020 in Laravel by Niroj
• 82,880 points
9,493 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,203 views
0 votes
1 answer

Error:Composer Out of memory in Laravel?

Hey @kartik, This Error  happens in almost all ...READ MORE

Mar 30, 2020 in Laravel by Niroj
• 82,880 points
9,170 views
0 votes
1 answer

How do you get the path to the Laravel Storage folder?

Hello @kartik, In Laravel 3, call path('storage'). In Laravel 4, ...READ MORE

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

How to unset or remove a collection element after fetching it?

Hello @kartik, You would want to use ->forget() $collection->forget($key); Hope it ...READ MORE

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

How to get all pending jobs in laravel queue on redis?

Hello @kartik, Here is the way I do ...READ MORE

Apr 6, 2020 in Laravel by Niroj
• 82,880 points
8,910 views
0 votes
1 answer

Error:The bootstrap/cache directory must be present and writable' error after update

Hello @kartik, Try this after you have run ...READ MORE

Aug 11, 2020 in Laravel by Niroj
• 82,880 points
8,818 views
0 votes
1 answer

How can I get the error message for the mail() function?

Hello @kartik, You can use error_get_last() when mai l()returns false. $success = mail('example@example.com', ...READ MORE

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

How to get image from resources in Laravel?

Hello @kartik, You can make a route specifically ...READ MORE

Oct 28, 2020 in Laravel by Niroj
• 82,880 points
8,416 views
+1 vote
1 answer

Error:file_put_contents(meta/services.json): failed to open stream: Permission denied?

Hello @kartik, Below steps helped me fix the ...READ MORE

Apr 3, 2020 in Laravel by Niroj
• 82,880 points
8,337 views
0 votes
1 answer

How to redirect to login if user is not authenticated in laravel?

Hello @kartik, Use middleware for this purpose and ...READ MORE

Oct 28, 2020 in Laravel by Niroj
• 82,880 points
8,172 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

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

Error:Loading composer repositories with package information Updating dependencies (including require-dev) Killed

Hello @kartik, The "Killed" message usually means your ...READ MORE

Aug 4, 2020 in Laravel by Niroj
• 82,880 points
7,559 views
0 votes
1 answer

How to pass data to mail View in laravel Mail send?

Hello @kartik, Send data like this. $data = [ ...READ MORE

Jul 30, 2020 in Laravel by Niroj
• 82,880 points
7,419 views