undersound
undersound
TCTwill CMS
Created by undersound on 4/28/2023 in #👊support
Fetch all models with field value of X
Sorry to ask such a basic question but I want to do the following.... I have a model called Work (and a WorkController and WorkRepository). On my Work module there is a field called "available" of type checkbox. Now i want to fetch all models with "available" selected. 1. What is best practice to implement a e.g. getAllAvailable() method? Is that on the WorkRepository, WorkController of Work model class? 2. How do I select all the models with that checkbox selected. In the laravel docs I saw this $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 guidance
19 replies
TCTwill CMS
Created by undersound on 4/6/2023 in #👊support
[3.0.0-rc4] - How to show current value in a select form field
Currently I have my select field defined as: @formField('select', [ 'name' => 'work_year', 'label' => 'Year', 'options' => range(date('Y'),1950), ]) The field is showing up and the selected value gets correctly saved to the database. Also when i click Update while on the page itself in the backend the selected value is showing in the field correctly. But when I close the page and reopen it in the backend the current value is not showing up. Thanks for any help or guidance https://twill.io/docs/3.x/form-fields/select.html
3 replies
TCTwill CMS
Created by undersound on 4/5/2023 in #👊support
[3.0.0-rc4] Images not found on remote server - League\\Glide\\Filesystem\\FileNotFoundException
I just went from my local to my remote server and some images are showing up others are getting a 500 error. Using Version 3.0.0-rc4 This is showing up as the last stacktraces in storage/logs/laravel.log production.ERROR: Could not find the image 890cc42b-6417-4f97-8680-9c77fa2a789c/20200618-124502.jpg. {"exception":"[object] (League\\Glide\\Filesystem\\FileNotFoundException(code: 0): Could not find the image 890cc42b-6417-4f97-8680-9c77fa2a789c/20200618-124502.jpg. at /var/www/example.com/web/vendor/league/glide/src/Server.php:629) [stacktrace] #0 /var/www/example.com/web/vendor/league/glide/src/Server.php(548): League\\Glide\\Server->makeImage() #1 /var/www/example.com/web/vendor/area17/twill/src/Services/MediaLibrary/Glide.php(95): League\\Glide\\Server->getImageResponse() #2 /var/www/example.com/web/vendor/area17/twill/src/Http/Controllers/Front/GlideController.php(12): A17\\Twill\\Services\\MediaLibrary\\Glide->render() #3 /var/www/example.com/web/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(46): A17\\Twill\\Http\\Controllers\\Front\\GlideController->__invoke() #4 /var/www/example.com/web/vendor/laravel/framework/src/Illuminate/Routing/Route.php(260): Illuminate\\Routing\\ControllerDispatcher->dispatch() #5 /var/www/example.com/web/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\\Routing\\Route->runController() #6 /var/www/example.com/web/vendor/laravel/framework/src/Illuminate/Routing/Router.php(798): Illuminate\\Routing\\Route->run() #7 /var/www/example.com/web/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}() Thumbnails are showing up correctly in the backend. Perhaps relevant when I try to run php artisan cache:clear I get ERROR Failed to clear cache. Make sure you have the appropriate permissions. ` Thanks for any guidance or help...
31 replies