File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 2121 "require" : {
2222 "backpack/crud" : " ^3.3.0" ,
2323 "spatie/laravel-fractal" : " ^5.2" ,
24- "webfactor/laravel-apicontroller" : " ^1.0.10"
24+ "spatie/laravel-translatable" : " ^2.1" ,
25+ "webfactor/laravel-apicontroller" : " ^1.0.10"
2526 },
2627 "require-dev" : {
2728 "phpunit/phpunit" : " ~6.0" ,
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ public function up()
1515 {
1616 Schema::create ('documents ' , function (Blueprint $ table ) {
1717 $ table ->increments ('id ' );
18- $ table ->string ('title ' );
18+ $ table ->text ('title ' );
1919 $ table ->text ('body ' );
2020 $ table ->string ('type ' );
2121 $ table ->timestamps ();
Original file line number Diff line number Diff line change 33namespace Webfactor \Laravel \Backpack \Documents \Models ;
44
55use Backpack \CRUD \CrudTrait ;
6+ use Backpack \CRUD \ModelTraits \SpatieTranslatable \HasTranslations ;
67use Illuminate \Database \Eloquent \Model ;
78
89/**
2627class Document extends Model
2728{
2829 use CrudTrait;
30+ use HasTranslations;
2931
3032 /*
3133 |--------------------------------------------------------------------------
@@ -39,6 +41,11 @@ class Document extends Model
3941 'body '
4042 ];
4143
44+ protected $ translatable = [
45+ 'title ' ,
46+ 'body '
47+ ];
48+
4249 /*
4350 |--------------------------------------------------------------------------
4451 | FUNCTIONS
You can’t perform that action at this time.
0 commit comments