bohous
04/25/2023, 10:25 PM'dashboard' => [
'modules' =>
[
'categories' =>
[
'name' => 'categories',
'label' => 'Category',
'create' => true,
'search' => true,
'count' => true,
],
'category' =>
[
'name' => 'categoryArticle',
'label' => 'Article',
'create' => true,
'search' => true,
'count' => true,
]
]
]
With config like that id i go to dashboard I have a error
Route [twill.categoryArticle.index] not defined.
my route twill.php file
TwillRoutes::module('categories');
TwillRoutes::module('categories.articles');
where I make a error.?
Thx for answerzeenux
04/27/2023, 7:24 PMundersound
04/28/2023, 8:53 AM$flights = Flight::where('destination', 'Paris')->get();
but I can't seem to use the where function on my model. E.g. Work::where is not working.
Thanks for any guidancethelongestsigh
04/28/2023, 9:44 AMzeenux
04/29/2023, 4:45 PMzeenux
04/30/2023, 2:39 PMzeenux
05/01/2023, 1:59 PMHoang
05/03/2023, 6:06 PMAntonyPL
05/04/2023, 7:26 AMhttps://cdn.discordapp.com/attachments/1103583421755834499/1103583422007480340/Zrzut_ekranu_2023-05-04_092603.png▾
thelongestsigh
05/04/2023, 8:55 AMthelongestsigh
05/04/2023, 1:06 PMObject { message: "Illuminate\\Database\\Grammar::parameterize(): Argument #1 ($values) must be of type array, string given, called in /var/www/libera/website/vendor/laravel/framework/src/Illuminate/Database/Query/Grammars/Grammar.php on line 1022", exception: "TypeError", file: "/var/www/libera/website/vendor/laravel/framework/src/Illuminate/Database/Grammar.php", line: 168, trace: (72) […] }
AntonyPL
05/05/2023, 6:34 AMhttps://cdn.discordapp.com/attachments/1103932645773160510/1103932646494588928/Zrzut_ekranu_2023-05-05_083330.png▾
zeenux
05/08/2023, 12:49 PMdpadular
05/09/2023, 6:06 PMupdate()
or save()
I just don't get any results, and don't get any errors.
This is my current attempt to query out the existing entries. Not sure how to update the model that this returns.
$existingProduct = Product::join('product_translations', 'products.id' , '=', 'product_translations.product_id')
->where('title', $productTitle)
->where('locale', 'en')
->where('products.deleted_at', null)
->where('product_translations.deleted_at', null)
->where('brand_id', $brandId)
->first();
zeenux
05/10/2023, 12:34 PMhelloworld
05/11/2023, 5:31 AMcrp87
05/11/2023, 8:26 AMcrp87
05/11/2023, 9:10 AMzeenux
05/11/2023, 11:00 AMbohous
05/13/2023, 4:43 AMMariaDB [laravel]> select * from twill_related;
+----+------------+-------------------------+------------+-----------------+--------------+----------+
| id | subject_id | subject_type | related_id | related_type | browser_name | position |
+----+------------+-------------------------+------------+-----------------+--------------+----------+
| 1 | 2 | App\Models\MenuPageLink | 7 | App\Models\Page | page | 1 |
| 2 | 3 | App\Models\MenuPageLink | 8 | App\Models\Page | page | 1 |
| 3 | 4 | App\Models\MenuPageLink | 6 | App\Models\Page | page | 1 |
But when I call in compoment $link->getRelated('page')->first()->slug}}
I have this error Attempt to read property "slug" on null
In my code.
The MenuPageLink.php
is use HasRelated;
In MenuPageLinkRepository.php
is
protected $relatedBrowsers = ['page'];
and use HandleNesting;
In MenuPageLinkController
is $form->add(Browser::make()->name('page')->modules([Page::class]));
I didnt understod what is wrong and why the getRelated()
didnt get the relations.
Thx for answerzeenux
05/13/2023, 10:44 AMcrp87
05/16/2023, 6:33 PMhttps://cdn.discordapp.com/attachments/1108099900211740772/1108099900471783444/Bildschirmfoto_2023-05-16_um_20.31.36.png▾
helloworld
05/17/2023, 9:03 AMhelloworld
05/19/2023, 7:50 AMhttps://cdn.discordapp.com/attachments/1109025375973015682/1109025376094654545/Screenshot_2023-05-19_at_3.49.35_PM.png▾
zeenux
05/19/2023, 1:14 PMkerkness
05/19/2023, 1:33 PMtwill:update
Two issues appear to be happening.
1) If I enter a date into the field then field saves as the previous day. Example, if I enter "May 15, 2023" the payload sent to twill submits "2023-05-15" but the value saved into the database is "2023-05-14"
2) If I select a date from the DatePicker popup then the payload is not updated unless I hit the "enter key". Removing focus from the field does not update the payload.
The module has the following migrations:
$table->date('start_date')->nullable();
$table->date('end_date')->nullable();
(These are not publish dates, they meant to show the start and end dates of an event.)
The model casts these fields to date and also includes $dates
as the docs seem to suggest. Although I'm pretty sure having both is redundant.
public $casts = [
'start_date' => 'date',
'end_date' => 'date',
];
public $dates = ['start_date', 'end_date'];
The controller uses getForm
method and adds fields with the following
$form->add(
Columns::make()
->left(
[DatePicker::make()
->name('start_date')
->allowInput(true)
->withoutTime(true)
->allowClear(true)]
)
->right(
[DatePicker::make()
->name('end_date')
->allowInput(true)
->withoutTime(true)
->allowClear(true)]
)
);
crp87
05/22/2023, 2:35 PMsavchuk.ivan
05/23/2023, 4:39 AMhttps://cdn.discordapp.com/attachments/1110426789353885726/1110426789496504471/2023-05-23_113751.png▾
savchuk.ivan
05/23/2023, 8:51 AM@formField('select', [
'name' => "role",
'label' => twillTrans('twill::lang.user-management.role'),
'options' => $roleList,
'placeholder' => twillTrans('twill::lang.user-management.role-placeholder'),
])
@formConnectedFields([
'fieldName' => 'role',
'fieldValues' => ['ADMIN'],
'renderForBlocks' => false,
])
@formField('checkboxes', [
'name' => 'privilege',
'label' => 'Привилегии',
'inline' => false,
'options' =>
\App\Domain\Enum\PrivilegeType::values(),
])
@endformConnectedFields
@formConnectedFields([
'fieldName' => 'role',
'fieldValues' => ['READER'],
'renderForBlocks' => false,
])
@formField('checkboxes', [
'name' => 'privilege',
'label' => 'Привилегии',
'inline' => false,
'options' =>
\App\Domain\Enum\PrivilegeType::values(),
])
@endformConnectedFieldsZiPavlin
05/24/2023, 7:58 AMphp artisan twill:make:componentBlock name
as per documentation, but none of them are available in block editor. I think I set up BlockEditor as it should be BlockEditor::make()->blocks(['Columns', 'text', 'imagetext', 'image'])
.
Do I need to register BlockComponents somewhere?