At first some praise: I really like the approach Twill takes - enabling developers to adjust the CMS to their needs and not interfering with Laravel. I did an extensive research on Laravel CMS solutions, but most of them seem to interfere somehow with Laravel or have other drawbacks. Keep up the good work.
Now my issue:
I followed the installation and added a CRUD module with the CLI:
php artisan twill:module news -T -M
In my translations.php I have three languages, (_en_, _de_, _fr_, no nesting, so not related to this issue)
Error
When I want to create an instance of the module with "Add New", I get:
UI: "Your content can not be edit, please retry"
Console: POST request fails due to an Internal Server Error (500).
Any ideas what the cause could be or how I get more helpful debug information from the Server?
Hey @Paluschki
Thank for your kind words.
Can you paste the full output of the log for that request?
You can access it under storage/logs/laravel.log or storage/logs/laravel-2019-03-06.log or similar.
In there we will be able to detect the line that it is triggering the exception.
Best.
Thanks, that helped resolve my problem. I had 3 errors:
1. Undefined property: MyApp\Models\News::$translatedAttributes
I had to uncomment the $translatedAttributes in the module.
2. SQLSTATE[42S22]: Column not found: 1054 Unknown column 'title' in 'field list'
Again, I saw that the default creation of translation fields was commented out in the migrations file.
My suspicion is the following: I mistakenly created the modules without translations first and reran the command with -T to get the translations. That seems not to work.
One other problem:
3. Class App\AnyPath\AnyTwillClass does not exist
I renamed my app into MyApp, but the modules created by Twill all use the namespace App\...
Am I doing something wrong in this regard? Is it a mistake of Twill, if I have to manually change all the occurences of App\ into MyApp\, or is something wrong with the settings in my Laravel app?
Thanks for your help so far, it is really appreciated!
Just updated Twill to v1.2.1 and modules were not working anymore:
App\Http\Controllers\<MyModule>Controller was nout found when I clicked on them in the admin interface. My suspicion is that it had something to do with renaming my Laravel app (like in 3. in my problem before).
After a rollback to the default name App (php artisan app:name App) everything works fine again.
Somehow Twill does not handle the different namespace of renamed Laravel apps correctly.
Renaming the default App namespace is now possible thanks to some updates in 1.2.2 by @antonioribeiro!
Most helpful comment
Renaming the default
Appnamespace is now possible thanks to some updates in 1.2.2 by @antonioribeiro!