<?php | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class CreateRegionCityHotelTable extends Migration | |
{ | |
/** | |
* Run the migrations. | |
* |
First, I'm happy to delete the following or move it to a gist if it doesn't belong here, but I think some real life example/use case might be a good idea. I will answer question if you have any.
I got a few places where this feature would be handy. I run an app where we have a bunch of stuff (Hotel/Restaurant/Shop/Activity) classified by Region (Like US State if it speaks more to you) then City.
Here is a stripped down example.
First, I'm french, sleep deprived, the last thing I want is to appear smug or passive aggressive because my english isn't good enough.
In yesterday's Advanced Querying with Eloquent talk (which was very good), you defined a lastInteraction
relation like this :
public function lastInteraction()
{
return $this->hasOne(Interaction::class, 'id', 'last_interaction_id');
}
public function scopeWithLastInteraction($query)
<?php | |
namespace Tests\Feature; | |
use App\Models\Model; | |
use Generator; | |
use Illuminate\Foundation\Testing\RefreshDatabase; | |
// use Illuminate\Support\Facades\Mail; | |
use Tests\TestCase; |
<usage> | |
<div class="h-64"> <!-- Set dimensions here --> | |
<FileInput v-model="file"/> | |
</div> | |
</usage> | |
<template> | |
<label | |
class="flex justify-center items-center relative rounded-lg overflow-hidden bg-gray-300 w-full h-full" | |
> |
Tailwindcss plugin that adds a small box in the lower right corner of the screen showing the current breakpoint
Uses a position: fixed
after
css pseudo element on the body, so no extra markeup, and it get the breakpoint list by itself.
<script> | |
export default { | |
render() { | |
return this.$scopedSlots.default({ | |
update: this.update, | |
data: this.$data.data | |
}) | |
}, | |
props: ['initialData', 'created', 'mounted'], | |
data() { |
<script> | |
import { ref } from '@vue/composition-api' | |
import { onScrollBottom } from '@/scroll' | |
export default { | |
setup () { | |
function loadMore () { | |
// ... | |
} | |