What do you want to save?
Add Code snippet
New code examples
-
PHP 2021-10-09 07:59:09
laravel passport
1 - composer require laravel/passport 2 - php artisan migrate 3 - php artisan passport:install 4 - go to user model <?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Foundation\Auth\User as Authentica... Add solution -
PHP 2021-10-06 14:03:04
get deleted value laravel
You can get also soft deleted record using withTrashed() of Laravel Eloquent. It will return all record from table. Item::withTrashed()->get(); You can get only soft deleted row using onlyTrashed() of Laravel Eloquent. Item::onlyTrashed()->get(); Add solution -
PHP 2021-10-03 19:03:03
create model for existing table in laravel
Yes, you can create a create a model php artisan make:model Profile and then create its controller to handle CRUD operations. (Rememer the name of the model should be singular, not plural so that automatically the name of the table becomes the pluraliza n... Add solution -
Other 2021-09-26 21:45:04
eloquest how to select one specific column in database
//Eloquent: Get specific columns (not all the row). Pluck returns an array. Model::where('id', 1)->pluck('name', 'surname'); // If you only want to get the result value: Model::where('id', 1)->value('name'); Add solution -
PHP 2021-09-26 03:39:03
auth.php Class "\App\User" not found
Go to config/auth.php and change App\User:class to App\Models\User::class. 'providers' => [ 'users' => [ 'driver' => 'eloquent', 'model' => App\Models\User::class, ], Also change the namespace of User.php model names... Add solution -
PHP 2021-09-24 23:55:03
laravel find or fail exception
use Illuminate\Database\Eloquent\ModelNotFoundException; // Will return a ModelNotFoundException if no user with that id try { $user = User::findOrFail($id); } // catch(Exception $e) catch any exception catch(ModelNotFoundException $e) { dd(get_c... Add solution
Best helpers
Ranking is empty