This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Types for the result object with discriminated union | |
| type Success<T> = { | |
| data: T; | |
| error: null; | |
| }; | |
| type Failure<E> = { | |
| data: null; | |
| error: E; | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script type="text/javascript"> | |
| function idleTimer() { | |
| var t; | |
| //window.onload = resetTimer; | |
| window.onmousemove = resetTimer; // catches mouse movements | |
| window.onmousedown = resetTimer; // catches mouse movements | |
| window.onclick = resetTimer; // catches mouse clicks | |
| window.onscroll = resetTimer; // catches scrolling | |
| window.onkeypress = resetTimer; //catches keyboard actions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div id="{{ $name }}" class="overlay"> | |
| <a href="#" class="cancel"></a> | |
| <div class="modal"> | |
| {{ $slot }} | |
| <a href="#" class="close">×</a> | |
| </div> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <template> | |
| <div v-click-outside="close"> | |
| <label v-if="label" class="form-label" @click="open">{{ label }}:</label> | |
| <div class="relative"> | |
| <div ref="input" @click="open" @focus="open" @keydown.down.prevent="open" @keydown.up.prevent="open" :class="{ focus: show, error: error }" class="form-input pr-6" :tabindex="show ? -1 : 0"> | |
| <slot v-if="value"></slot> | |
| <div v-else-if="data.length === 0" class="text-grey-600">No options found</div> | |
| <div v-else class="text-grey-600">Click to choose…</div> | |
| </div> | |
| <button type="button" @click.stop="clear" v-if="value" tabindex="-1" class="absolute p-2 inline-block text-grey-500 hover:text-amber-700" style="right: 4px; top: 8px;"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| use Illuminate\Database\Eloquent\Builder as EloquentBuilder; | |
| use Illuminate\Database\Query\Builder as QueryBuilder; | |
| use Illuminate\Database\Query\Expression; | |
| use Illuminate\Support\ServiceProvider; | |
| class AppServiceProvider extends ServiceProvider | |
| { | |
| public function boot() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App; | |
| use App\Scopes\WithSelects; | |
| use Illuminate\Foundation\Auth\User as Authenticatable; | |
| use Illuminate\Notifications\Notifiable; | |
| class User extends Authenticatable | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Providers; | |
| use Illuminate\Support\Facades\View; | |
| use Illuminate\Support\ServiceProvider; | |
| use Illuminate\View\Factory as ViewFactory; | |
| class AppServiceProvider extends ServiceProvider | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Usage: | |
| // <vue-form method="PUT"> | |
| // <input type="text" name="email"> | |
| // <input type="submit"> | |
| // </vue-form> | |
| <template> | |
| <form :method="method.toUpperCase() == 'GET' ? 'GET' : 'POST'"> | |
| <input-hidden :value="csrfToken" name="_token"/> |
NewerOlder