Most voted questions in Laravel

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
500 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,490 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,505 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,639 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,209 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
899 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,323 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,332 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,885 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,326 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,027 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,054 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,242 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,111 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,679 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,910 views
0 votes
1 answer

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

Hello @kartik, Your response must return some sort ...READ MORE

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

How can I query raw via Eloquent?

Hello @kartik, You may try this: // query can't ...READ MORE

Sep 24, 2020 in Laravel by Niroj
• 82,880 points
992 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,643 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,214 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,834 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,634 views
0 votes
0 answers

How do I access to a variable inside a function?

I mean,I have public class MyClass{ ...READ MORE

Sep 21, 2020 in Laravel by aakash
• 230 points

edited Sep 21, 2020 by Niroj 1,094 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,422 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,917 views
0 votes
1 answer

How to get client IP address in Laravel >5?

Hello @kartik, Use request()->ip(). Since Laravel 5 it's advised/good practice ...READ MORE

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

Error: reverting ./composer.json to its original content

Hello @kartik, I used to use this: composer require ...READ MORE

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

How to select count with Laravel's fluent query builder?

Hello @kartik, You can use an array in ...READ MORE

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

How to pass data to view in Laravel?

Hello @kartik, You can pass data to the ...READ MORE

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

How to get the id when you're validating in the model Validation unique on update using laravel?

Hello @kartik, in Laravel's inbuilt auth system, the ...READ MORE

Sep 11, 2020 in Laravel by Niroj
• 82,880 points
6,315 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,936 views
0 votes
0 answers

I am unable to send emails on my php script

I am unable to send emails from ...READ MORE

Sep 6, 2020 in Laravel by Titus
• 160 points

recategorized Sep 6, 2020 by Niroj 839 views
0 votes
1 answer

I get this error > Trying to get property of non-object . How to fix it?

Hello @aakash, If you want to save grades ...READ MORE

Aug 17, 2020 in Laravel by Niroj
• 82,880 points
23,288 views
0 votes
1 answer

Error:ReflectionException: Class ClassName does not exist - Laravel

Hello @kartik, Perform a composer update, then composer dump-autoload. If the ...READ MORE

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

How to only use created_at in Laravel?

Hello @kartik, Eloquent does not provide such functionality ...READ MORE

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

How do I catch exceptions / missing pages in Laravel 5?

Hello @kartik, In Laravel 5 you can catch ...READ MORE

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

How to get current path of a Request with its query parameters?

Hello @kartik, Try to use the following: \Request::getRequestUri() Hope this ...READ MORE

Aug 11, 2020 in Laravel by Niroj
• 82,880 points
1,750 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,840 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,393 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,826 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,046 views
0 votes
1 answer

How do I get HTTP Request body content in Laravel?

Hello @kartik, Inside controller inject Request object. So ...READ MORE

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

How do I write to the console from a Laravel Controller?

Hello @kartik, This can be done with the ...READ MORE

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

How can I echo the version of the current Laravel version in php using the view?

Hello @kartik, This is the way how to ...READ MORE

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

How to run specific migration in laravel?

Hello @kartik, Use this command: php artisan migrate --path=/database/migrations/my_migration.php  And ...READ MORE

Aug 10, 2020 in Laravel by Niroj
• 82,880 points
3,663 views