Charton
11/08/2021, 10:25 AMCharton
11/08/2021, 10:25 AMifox
11/08/2021, 10:25 AMHarings Rob
11/08/2021, 10:28 AMMedia::addGlobalScope(new TeamScope()); to make sure I only show relevant media.
In addition to that I added something like this:
Media::creating(function ($model) {
if (Auth::user()?->id && !$model->user_id) {
$model->user_id = Auth::user()->id;
$model->team_id = Auth::user()->current_team_id;
}
});
The only challenge you will have is to know what "scope" you are in, and the above might not help you at all 😄ifox
11/08/2021, 10:30 AMHarings Rob
11/08/2021, 10:30 AMHarings Rob
11/08/2021, 10:30 AMHarings Rob
11/08/2021, 10:31 AMifox
11/08/2021, 10:31 AMifox
11/08/2021, 10:32 AMHarings Rob
11/08/2021, 10:38 AMifox
11/08/2021, 10:43 AMHarings Rob
11/08/2021, 10:44 AMuser
11/08/2021, 6:41 PMifox
11/08/2021, 6:46 PMpboivin
11/08/2021, 8:05 PM$pivotAttributes param of updateBrowser(), something like:
$this->updateBrowser($object, $fields, 'categories', 'position', null, [
'attribute' => 'value',
]);
https://twill.io/docs/api/2.x/A17/Twill/Repositories/Behaviors/HandleBrowsers.html#method_updateBrowseruser
11/08/2021, 8:40 PMphp
$this->updateBrowser($object, $fields, 'categories', 'position',['value']);
Thank you for replying. I'll give it another go asap.ifox
11/08/2021, 8:55 PMLuís Novais
11/08/2021, 10:50 PMpboivin
11/08/2021, 11:05 PM_wysiwyg.blade.php file in your project. You can copy the original file to resources/views/admin/partials/form/_my_wysiwyg.blade.php and change the default value, something like:
$toolbarOptions = $toolbarOptions ?? ['bold', 'italic'];
Then, you can use your customized field like a regular field:
@formField('my_wysiwyg', [
'name' => 'body',
'label' => 'Body',
'translated' => true,
])rookiespoiler
11/09/2021, 6:07 PMlayouts\block.blade.php for rendering on admin site.
On client-side, these two have slightly different styles (different width of the content container) but use same blocks.
In my layouts\block.blade.php I have some styles in head element, making the visual 100% same with the width like on the client-side. But that works only for one model, since the second one needs that slightly different modification in visual.
Is there any way I can provide information in my block.blade.php that I'm currently on article's edit page or the other one? Or maybe a way to split that up?
Tried @dd for defined vars but since it's called in an iframe, it looked stupid to me and I felt like I'm running in circles.
Thank you for help!pboivin
11/09/2021, 6:31 PMpboivin
11/09/2021, 6:32 PMclass PageController extends BaseModuleController
{
protected $moduleName = 'pages';
public function edit($id, $submoduleId = null)
{
session(['preview_context' => 'page']);
return parent::edit($id, $submoduleId);
}
}
Then, in your block layout:
<html>
<head>
...
</head>
<body class="preview-context-{{ session('preview_context') }}">
...
</body>
</html>rookiespoiler
11/09/2021, 6:49 PMpboivin
11/09/2021, 6:50 PMrookiespoiler
11/09/2021, 6:51 PMpboivin
11/09/2021, 6:51 PMHarings Rob
11/09/2021, 7:17 PMpboivin
11/09/2021, 7:19 PM/blocks/preview requestSami
11/09/2021, 8:01 PM