Skip to content

naykel76/gotime

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Total Downloads Latest Stable Version License

NAYKEL Gotime

Starter package for NayKel Laravel applications.

Installation

To get started, install Gotime using the Composer package manager:

composer require naykel/gotime

Next, install Gotime resources using the gotime:install command:

php artisan gotime:install

The configuration files are merged when the package is registered, however you can optionally publish the naykel.php configuration file.

php artisan vendor:publish --tag=gotime-config

Known Issues

This driver does not support creating temporary URLs.

https://laracasts.com/discuss/channels/livewire/pdf-passes-image-validation?page=1&replyId=806087

livewire/livewire#3133 (comment)

if (! $this->isPreviewable()) {
    // show a missing image icon (?) for files that cannot be previewed
    return 'data:image/png;base64...gg-1.5==';
}

Mount the resources or create a blank model

Depending on the route, the Livewire component will either mount a resource and set $editing with route model binding or create a new blank model setting initial values from the $initalValues array.

Adding the main image

The $tmpImage variable is set in the trait as there will be no need to manually use it. ??

The image paramt

  1. Set the $disk or leave blank for public ????

Defined attributed in the trait can be reset or overrider in the mount() method of the main component

Things I learned the Hard Way

Do not define a variable data type that is a file as a string. Why? It's a file, not a string!

CkEditor

<div wire:ignore class="frm-row">
    <textarea wire:model.blur="editing.description" name="editing.description" id="ckeditor"></textarea>
</div>

@push('scripts')
<script src="https://cdn.ckeditor.com/ckeditor5/27.1.0/classic/ckeditor.js"></script>
<script>
    ClassicEditor
        .create(document.querySelector('#ckeditor'))
        .then(editor => {
            editor.model.document.on('change:data', () => {
                @this.set('editing.description', editor.getData());
            })
        })
        .catch(error => {
            console.error(error);
        });
</script>

@endpush

Adding New Icons

  1. update extension svg to blade.php
find ./resources/views/components/v2/icon -name "*.svg" -type f -exec bash -c 'mv -- "$0" "${0%.svg}.blade.php"' {} \;
  1. add $attributes, width and height
# DON'T RUN THIS WITH EXPORTED FIGMA ICONS, IT WILL ADD THE ATTRIBUTES TWICE
find ./resources/views/components/v2/icon -type f -name "*.blade.php" -exec sed -i 's/<svg xmlns="http:\/\/www\.w3\.org\/2000\/svg"/<svg {{ $attributes }} xmlns="http:\/\/www\.w3\.org\/2000\/svg" width="24" height="24"/g' {} +
# FOR FIGMA ICONS
find ./resources/views/components/v2/icon -type f -name "*.blade.php" -exec sed -i 's/<svg xmlns="http:\/\/www\.w3\.org\/2000\/svg"/<svg {{ $attributes }} xmlns="http:\/\/www\.w3\.org\/2000\/svg"/g' {} +

About

Starter package for NayKel Laravel applications

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages