havvtom

havvtom

Member Since 7 Months Ago

Experience Points
14,360
Total
Experience

640 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
135
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 3
14,360 XP
Oct
18
2 days ago
Activity icon

Replied to Different Inputs Binding To One Property

Thanks a lot rodrigo.pedra for taking your time to explain this clearly. I really appreciate it

Activity icon

Started a new Conversation Different Inputs Binding To One Property

When i type on any one input field, all the other input fields auto-fill with the value that I am typing in. What might be the probem? Your assistance will be greatly appreciated.

<template>
	<div>
		{{ experiences }}
		<div class="d-flex justify-content-between" 
			v-if="experiences.length"
			v-for="(experience, index) in experiences"
			:key="index"
		>
			<input 
				type="" 
				name=""
				v-model = "experience.company"
			>
								
			<button @click.prevent="removeExperience(index)">Delete</button>
		</div>
		<div class="d-flex justify-content-between">
			<input type="" name="">
			<button @click.prevent="addMore">Add More</button>
		</div>		
	</div>
</template>
<script type="text/javascript">
	export default {
		data () {
			return {
				experience: { company: '' },
				experiences: []
			}
		},
		methods: {
			addMore () {
				this.experiences.push(this.experience)
			},
			removeExperience (i) {
				this.experiences.splice(i, 1)
			}
		},
	}
</script>
Sep
17
1 month ago
Activity icon

Replied to Getting Unknown Formatter Name When Running Tests

The error reads:

InvalidArgumentException: Unknown formatter "name"

Activity icon

Started a new Conversation Getting Unknown Formatter Name When Running Tests

May you help me, identifying what I am doing wrong!!! I am getting an error when running my tests. My factory is as below

<?php

namespace Database\Factories;

use App\Models\Category;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;

class CategoryFactory extends Factory
{
    /**
     * The name of the factory's corresponding model.
     *
     * @var string
     */
    protected $model = Category::class;

    /**
     * Define the model's default state.
     *
     * @return array
     */
    public function definition()
    {
        
        return [
            'name' => $name = $this->faker->name,
            'parent_id' => 1,
            'order' => 1,
            'slug' => Str::slug($name)
        ];
    }
}

and my test is

<?php

namespace Tests\Unit\Models\Categories;

use PHPUnit\Framework\TestCase;
use App\Models\Category;

class CategoryTest extends TestCase
{
    /**
     * A basic unit test example.
     *
     * @return void
     */
    public function testExample()
    {
        $this->assertTrue(true);
    }

    public function test_it_has_many_children()
    {
    	$category = Category::factory()->create(['parent_id' => null]);

    	$category->children()->save([
    		Category::factory()->create(['parent_id' => 1])
    	]);

    	$this->assertInstanceOf(Category::class, $category->children->first());
    }
}

Jul
01
3 months ago
Activity icon

Started a new Conversation Passing Value To Algolia SearchClient From AsyncData

I want help in changing the const searchClient. The problem is, its not part of export default. I am getting the value that I want to input from asyncData. You can look at me code below

<template>
  <ais-instant-search-ssr>
    
  </ais-instant-search-ssr>
</template>

<script>
import SearchSnippetCard from './components/SearchSnippetCard'
import {
  AisInstantSearchSsr,
  AisIndex,
  AisConfigure,
  AisRefinementList,
  AisHits,
  AisHighlight,
  AisSearchBox,
  AisStats,
  AisStateResults,
  AisPagination,
  createServerRootMixin,
  AisPoweredBy,
} from 'vue-instantsearch'; // eslint-disable-line import/no-unresolved
import algoliasearch from 'algoliasearch/lite';

const searchClient = algoliasearch(
  '3LEB06DEL9',
  'key from asyncData'
);

export default {
  data () {
    return {
      results: null
    }
  },
  mixins: [
    createServerRootMixin({
      searchClient,
      indexName: 'snippets',
    }),
  ],
  serverPrefetch() {
    return this.instantsearch.findResultsState(this).then(algoliaState => {
      this.$ssrContext.nuxt.algoliaState = algoliaState;
    });
  },
  beforeMount() {
    this.results = window.__NUXT__.algoliaState;

    this.instantsearch.hydrate(this.results);

  },
  components: {
    AisInstantSearchSsr,
    AisIndex,
    AisConfigure,
    AisRefinementList,
    AisHits,
    AisHighlight,
    AisSearchBox,
    AisStats,
    AisStateResults,
    AisPagination,
    SearchSnippetCard,
    AisPoweredBy
  },
  async asyncData({ app }) {
    let key = await app.$axios.get('keys/algolia')
    //I intend to use this key in the searchClient public key
  },
  mounted () {
   
  },
  head() {
    return {
      title: 'Search'
    }
  }
};
</script>
May
03
5 months ago
Activity icon

Replied to Picture Not Showing Using The Url Source

Thanks @bugsysha , you are a life saver

Activity icon

Replied to Picture Not Showing Using The Url Source

Thanks @bugsysha, let me try to explain, below is the json response I am getting and the media.data.url is the image.url I am binding to the src. The path is correct and the images are there

"data": [
{
"id": 1,
"body": "with images",
"type": "tweet",
"likes_count": 0,
"retweets_count": 0,
"original_tweet": null,
"user": {
"username": "havvtom",
"name": "Tom",
"avatar": "/images/default-avatar.jpeg"
},
"media": {
"data": [
{
"url": "http://localhost/media/1/black-flat-screen-computer-monitor-on-black-wooden-table-3937174.jpg",
"type": "image"
},
{
"url": "http://localhost/media/2/low-angle-shot-of-two-green-palm-trees-3560451---Copy---Copy.jpg",
"type": "image"
}
]
},
"created_at": 1588523962
Activity icon

Replied to Picture Not Showing Using The Url Source

TweetResource

public function toArray($request)
    {
        return [

            'id' => $this->id,
            'body' => $this->body,
            'type' => $this->type,
            'likes_count' => $this->likes->count(),
            'retweets_count'=> $this->retweets->count(),
            'original_tweet' => new TweetResource($this->originalTweet),
            'user' => new UserResource($this->user),
            'media' => new MediaCollection($this->media), 
            'created_at' => $this->created_at->timestamp
        ];
    }

MediaResource

public function toArray($request)
    {
        return [
            'url' => $this->baseMedia->getFullUrl(),
            'type' => $this->baseMedia->type()
        ];
    }

MediaCollection

public $collects = MediaResource::class;
    /**
     * Transform the resource collection into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        return [
            'data' => $this->collection
        ];
    }
Activity icon

Started a new Conversation Picture Not Showing Using The Url Source

I am using laravel media library and using the getFullUrl method. When I bind the url to the media, I receive a 404 not found error. Below is my part of my vue component


			<div class="flex flex-wrap mt-4 mb-4" v-if="images.length">
				<div class="flex-grow w-6/12" v-for="(image, index) in images" :key="index">
					<img :src="image.url">
				</div>
			</div>

			<app-tweet-action-group 
				:tweet="tweet"
			/>
		</div>
	</div>
</template>

<script type="text/javascript">
	export default {
		props: {
			tweet: {
				required: true,
				type: Object
			}
		},
		computed: {
			images () {
				return this.tweet.media.data.filter(m => m.type === 'image')
			}
		}
	}