Comments (2)
@empsean i'm sorry for delay really i'm very busy, so I make a similar example and it works without any problem
please check your code with the below lines.
db Schema
Schema::create('todos', function (Blueprint $table) {
$table->increments('id');
$table->uuid('uuid');
$table->string('name');
$table->text('body');
$table->timestamps();
});
Todo model
namespace App;
use Emadadly\LaravelUuid\Uuids;
use Illuminate\Database\Eloquent\Model;
class Todo extends Model
{
use Uuids;
protected $fillable = [
'uuid', 'name', 'body',
];
}
todoController
namespace App\Http\Controllers;
use App\Todo;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
class todoController extends Controller
{
public function saveUUID(Request $request){
$example = new Todo;
$example->name = 'test';
$example->body = 'body';
$example->save();
return response()->json(['example' => $example]);
}
}
from laravel-uuid.
Hi @EmadAdly
Thanks for responding, I did in fact get it working in the end.
from laravel-uuid.
Related Issues (20)
- Checking whether a record with generated Uuid exists HOT 7
- uuid is not saved when using model observer HOT 3
- uuid is not saved with pivot HOT 5
- Automatitly generate uuid for an existing table HOT 2
- Can not work in Laravel 5.7 HOT 1
- Laravel 5.7 & UUID HOT 7
- Laravel 5.8 HOT 1
- Laravel 6 HOT 1
- Add support laravel 6.2 up HOT 1
- Insert the autoincrement ID in the foreign keys instead of the UUID
- Documentation suggests both unique and primary index on the id column HOT 1
- Creating new record manually setting primary UUID HOT 1
- Support for laravel 7.0 HOT 2
- Note about casting the UUID when using Auth
- Auto discovery features issues
- PHP 8 support HOT 3
- Pipeline failed for PHP8 support HOT 1
- Laravel 9 Support HOT 1
- Laravel 9 update not published HOT 2
- Too few arguments to function Illuminate\Database\Eloquent\Model::setAttribute(), 1 passed in /var/www/app/PRS_System_V3/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php on line 1036 and exactly 2 expected
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravel-uuid.