24kappa
08/05/2022, 7:42 AMdakaalim
08/05/2022, 10:43 AMpatterns
(https://generateblocks.com/library/) for wordpress developers to pick and use on any template. Can Twill.io achieve something similar?ifox
08/05/2022, 1:35 PMdakaalim
08/05/2022, 2:31 PMifox
08/05/2022, 4:46 PMifox
08/05/2022, 4:47 PMifox
08/05/2022, 4:48 PMdakaalim
08/06/2022, 6:13 AMifox
08/06/2022, 7:25 AMdakaalim
08/06/2022, 7:54 AMdakaalim
08/07/2022, 8:29 AMload project folder modules -> load project folder capsule modules -> load vendor folder capsule modules
I managed to submit a Laravel package containing some Twill Capsules that I normally use. The issue I'm facing now is, I'm not sure how I can allow people to override my Twill Capsules (i.e. migrations, forms), just in case if they want to modify them (adding or removing fields)
At the moment, I have included the line below in the package's `TheiaTwillServiceProvider`:
$this->publishes([
__DIR__ . '/Twill/Capsules' => app_path('Twill/Capsules'),
], 'theia-twill-capsules');
dakaalim
08/07/2022, 8:31 AMvendor:publish
and it will duplicate all the capsules to the project's app path, my assumption was after they do the below as well, they should be able to override the capsules in the package:
Setup a new CMS menu item in config/twill-navigation.php:
'testModules' => [
'title' => 'TestModules',
'module' => true,
],
Setup your new Capsule in config/twill.php:
'capsules' => [
'list' => [
[
'name' => 'TestModules',
'enabled' => true,
],
],
],
Migrate your database.
of course this didn't work, it gave me errors such as migration file for xyz table already exists etc, I'm just showing my attempt.ifox
08/07/2022, 5:13 PMdakaalim
08/07/2022, 9:56 PMifox
08/07/2022, 10:01 PMdakaalim
08/07/2022, 10:07 PMdakaalim
08/07/2022, 10:13 PMifox
08/08/2022, 8:51 AMifox
08/08/2022, 8:54 AMMedvedOurs
08/09/2022, 11:27 AMkalle
08/09/2022, 11:35 AMMedvedOurs
08/09/2022, 11:43 AMkalle
08/09/2022, 12:20 PMMedvedOurs
08/09/2022, 12:23 PMMedvedOurs
08/09/2022, 1:21 PMclass ChangeSessionCookieNameForCms
{
/**
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if (request()->getHost() == Config::get('twill.admin_app_url')) {
$newSession = Config::get('twill.cookie_name');
Session::setName($newSession);
Config::set('session.cookie', $newSession);
}
return $next($request);
}
}
Shiftless
08/09/2022, 2:39 PMifox
08/09/2022, 2:50 PMShiftless
08/09/2022, 2:50 PMifox
08/09/2022, 2:50 PMdakaalim
08/09/2022, 10:33 PMphp artisan twill:make:capsule --singleton AboutPage