lara_crass

Member Since 6 Months Ago

Cebu City

Experience Points
20,890
Total
Experience

4,110 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
151
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.

  • Community Pillar

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

Level 5
20,890 XP
Mar
30
1 week ago
Activity icon

Commented on Trending Threads With Redis

Thank you very much!

Feb
25
1 month ago
Activity icon

Replied to 405 Method Not Allowed With Axios

Thank you for sharing! We do exactly the same thing with the href="{{ url($thread->path()) }}". This solved my problem with the axios.patch in episode 32 build a forum.

Jan
08
3 months ago
Activity icon

Commented on Task UI Updates: Part 2

had the same problem as above. This fixes it.

Jan
05
3 months ago
Activity icon

Commented on A Project Requires An Owner

Nice question!

My understanding is that, project() method in User model establishes user and project eloquent relationship. Without it, $user->projects; would not work. The reason why there's no () in $user->projects; - like it's accessed like a public attribute is that it fetches all instances of project associated with User rather than calling project() method itself.

Hope this helps :) This was discussed in Tweety final project in laravel from scratch

Dec
19
3 months ago
Activity icon

Commented on Tweaking The Activity Card

@lemmon agreed. This could be seen when you login a different user which was not done here. better to stick with activityOwner()

Dec
18
3 months ago
Activity icon

Commented on Wrap It Up

Thanks for this series!

Dec
12
3 months ago
Activity icon

Commented on The New Project Modal: Behavior

for those having problems with the create button you could try overriding the axios baseURL like so,

submit() {
	axios.defaults.baseURL = 'http://localhost/Laravel/birdboard/public/';

	axios.post('/projects', this.form)
		.then(response => {
			location = response.data.message;
		})
		.catch(error => {
			this.errors = error.response.data.errors;
		});

and add url() in ProjectsController store()

public function store()
{
    $project = auth()->user()->projects()->create($this->validateRequest());

    if (request()->wantsJson()) {
        return ['message' => url($project->path())];
    }

    return redirect($project->path());
}

if you're not in run npm watch make sure you run npm dev everytime you change something in NewProjecModal.vue

Activity icon

Commented on The New Project Modal

Thank you!

Activity icon

Commented on The New Project Modal

Had the same problem and fixed it, thanks to you both!

Dec
08
4 months ago
Activity icon

Commented on Get Into The Refactor Flow

Yep. Don't forget to import Arr:: through adding use Illuminate\Support\Arr; in Task model and RecordsActivity trait

Dec
05
4 months ago
Activity icon

Commented on Project Activity Feeds

For laravel 7, you can set up the migration using constrained() like so,

    public function up()
    {
        Schema::create('activities', function (Blueprint $table) {
            $table->id();
            $table->foreignId('project_id')->constrained()->onDelete('cascade');
            $table->string('description');
            $table->timestamps();
        });
    }
Dec
02
4 months ago
Activity icon

Commented on Go Go Gadget Tailwind

Thank you!

Activity icon

Commented on Prepping The Frontend

This might help. Please refer to https://laracasts.com/series/laravel-6-from-scratch/episodes/55 on how to install laravel 7 and get tailwind to work

using Laravel v.7 and installing latest tailwind will give an error

composer require laravel-frontend-presets/tailwindcss --dev // error requires laravel 8

install tailwindcss v4.2 instead

composer require laravel-frontend-presets/tailwindcss="4.2" --dev

refer to https://packagist.org/packages/laravel-frontend-presets/tailwindcss#4.2.0

Activity icon

Commented on Twitter Clone Setup

UPDATE 12/2/2020

For those using Laravel v.7 and installing tailwind

composer require laravel-frontend-presets/tailwindcss --dev // error requires laravel 8

install tailwindcss v4.2 instead

composer require laravel-frontend-presets/tailwindcss="4.2" --dev

refer to https://packagist.org/packages/laravel-frontend-presets/tailwindcss#4.2.0

Dec
01
4 months ago
Activity icon

Commented on The Create Project View

projects.create.blade.php

<!DOCTYPE html>
<html>
<head>
	<title></title>
	<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.2/css/bulma.css">
</head>
<body>
	<form method="POST" action="{{ url('/projects')}}"class="container" style="padding-top: 40px">
		@csrf
		
		<h1 class="heading">Create a Project</h1>

		<div class="field">
			<label class="label" for="title">Title</label>

			<div class="control">
				<input type="text" class="input" name="title" placeholder="Title">
			</div>
		</div>

		<div class="field">
			<label class="label" for="description">Description</label>

			<div class="control">
				<textarea name="description" class="textarea"></textarea>
			</div>			
		</div>

		<div class="field">
			<div class="control">
				<button type="submit" class="button is-link">Create Project</button>
			</div>			
		</div>
	</form>
</body>
</html>
Nov
30
4 months ago
Activity icon

Commented on Model Tests

Thank you!

Activity icon

Commented on Model Tests

Thank you!

Activity icon

Commented on A Project Requires An Owner

thanks!

Nov
28
4 months ago
Activity icon

Commented on Reaching Into Iframes

welcome.blade.php

<title>iFrame Example</title>

<script src="https://cdn.jsdelivr.net/gh/alpinejs/[email protected]/dist/alpine.min.js">
        defer
</script>

<h1>iFrame Time</h1>

<iframe></iframe>

<script>
    let loadIframe = () => {
        let iframe = document.querySelector('iframe');

        iframe.setAttribute('src', 'http://my-app.test/iframe');
    };

    loadIframe();
</script>
Activity icon

Commented on Let's Test The Laracasts Login Modal

This might help

context('with invalid credentials', () => {

	it('requires a valid email address', () => {
		cy.get('#email').type('foobar');

		cy.contains('button', 'Login').click();
		cy.get('[type="email"]').then(($input) => {
			expect($input[0].validationMessage).
			to.eq('Please include an \'@\' in the email address.\'foobar\' is
                        missing an \'@\'.');
	});
});
Nov
12
4 months ago
Activity icon

Commented on Twitter Clone Setup

This worked! Thank you. I lost the styling in the home page though but changing

mix('css/app.css')

to

asset('css/app.css')

in layouts.app solves the issue for me

Nov
05
5 months ago
Oct
26
5 months ago
Activity icon

Replied to Login Fails After Changing User Model

this solved the same problem I have in the Tweety project in Laravel from scratch (laravel v.7)

Oct
22
5 months ago
Activity icon

Commented on Build A Like/Dislike System

thanks!

Oct
21
5 months ago
Activity icon

Commented on File Storage And Custom Avatars

This worked! Thanks

Oct
20
5 months ago
Activity icon

Commented on Construct The Profile Page

profiles.show.blade.php (adjust as needed)

@extends('layouts.app')

@section('content')
    <header class="mb-6 relative">
        <div class="relative">
            <img src="{{ asset('images/default-profile-banner.jpg') }}" 
                  alt=""
                  class="mb-2"
            >

            <img src="{{ asset('images/hd_avatar.jpg') }}"
                 alt=""
                 class="rounded-full mr-2 absolute bottom-0 transform -translate-x-1/2 translate-y-1/2"
                 style="left: 50%"
                 width="150"
            >
        </div>

        <div class="flex justify-between items-center mb-6">
            <div style="max-width: 270px">
                <h2 class="font-bold text-2xl mb-0">{{ $user->name }}</h2>
                <p class="text-sm">Joined {{ $user->created_at->diffForHumans() }}</p>
            </div>

            <div class="flex">
                {{-- @can ('edit', $user) --}}
                    <a href=""
                       class="rounded-full border border-gray-300 py-2 px-4 text-black text-xs mr-2">
                   Edit Profile</a>
                {{-- @endcan --}}

                <a href=""
                    class="bg-blue-500 rounded-full shadow py-2 px-4 text-white text-xs mr-2">
                Follow me</a>
            </div>
        </div>
        <img 
            src="{{ asset('images/avatar.jpg') }}"  
            alt="" 
            class="rounded-full mr-2 absolute"
            style="width: 150px; left: calc(50% - 80px); top: 42%" 
        >

        <p class="text-sm">
            The name’s Bugs. Bugs Bunny. Don’t wear it out. Bugs is an anthropomorphic gray
            and white rabbit or hare who is famous for his flippant, insouciant personality.
            He is also characterized by a Brooklyn accent, his portrayal as a trickster,
            and his catch phrase "Eh...What's up, doc?"
        </p>


    </header>
    
    @include('_timeline', [
        'tweets' => $user->tweets
    ])
@endsection
Activity icon

Commented on Design The Timeline

home.blade.php

@extends('layouts.app')

@section('content')
    <div class="lg:flex lg:justify-between">
        <div class="lg:w-32">
            @include('_sidebar-links')
        </div>
        <div class="lg:flex-1 lg:mx-10" style="max-width:700px">
             @include('_publish-tweet-panel')

            <div class="border border-gray-300 rounded-lg">
                @include('_tweet')
                @include('_tweet')
                @include('_tweet')
                @include('_tweet')                
            </div>
        </div>
        <div class="lg: w-1/6 bg-blue-100 rounded-lg p-4">
            @include('_friends-list')
        </div>
    </div>
@endsection

_tweet.blade.php

<div class="flex p-4 border-b border-b gray-400">
    <div class="mr-2 flex-shrink-0">
        <img 
            src="images/default_avatar.jpg" 
            alt="" 
            class="rounded-full mr-2"
        >
        
    </div>

    <div>
        <h5 class="font-bold mb-4">John Doe</h5>
        <p class="text-sm">Presumably, if you're watching this series, you've already made the decision to embrace all that Laravel has to offer. However, if you're still on the fence, give me just a moment to sell you on why I believe Laravel is the best framework choice in the PHP world.
        </p>
    </div>   
</div>

_publish.tweet

<div class="border border-blue-400 rounded-lg px-8 py-6 mb-8">
    <form action="">
        <textarea 
        name="body"
        class="w-full" 
        placeholder="What's up doc?"  
        ></textarea>

        <hr class="my-4">

        <footer class="flex justify-between">
            <img 
                src="images/default_avatar.jpg"  
                alt="" 
                class="rounded-full mr-2"
            >
        <button type="submit" class="bg-blue-500 rounded-lg shadow py-2 px-2 text-white">Tweet-a-roo!</button>

        </footer>

    </form>
</div>

_friends-list.php

<h3 class="font-bold text-xl mb-4">Friends</h3>
<ul>
    @foreach(range(1, 8) as $index)
        <li class="mb-4">
            <div class="flex items-center text-sm">
                <img src="images/default_avatar.jpg" 
                alt=""
                class="rounded-full mr-2">
                John Doe
            </div>
        </li>
    @endforeach
</ul>
Oct
19
5 months ago
Activity icon

Commented on Twitter Clone Setup

Thanks! What I did:

composer create-project --prefer-dist laravel/laravel tweety "7.x"
cd tweety
composer require laravel/ui="2.*"
php artisan ui vue --auth
npm install tailwind css
//edit webpack.mix.js
npm install
npm run dev
php artisan migrate:fresh
Activity icon

Commented on Understanding Foreign Keys And Database Factories

i did it one by one in php artisan tinker. i can't seem to do it by batch

Oct
18
5 months ago
Activity icon

Commented on Limit Access To Authorized Users

For those using laravel 8 getting the error, undefined property: Database\Factories\ReplyFactory::$user

<?php

namespace Database\Seeders;

use App\Models\Conversation;
use App\Models\Reply;
use App\Models\User;
use Illuminate\Database\Seeder;

class ConversationsSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        User::factory(5)->create();
        Conversation::factory(5)->create();
        Reply::factory(15)->create();
    }
}
Oct
17
5 months ago
Activity icon

Commented on Eventing Pros And Cons

For those having a blank page even after modifying EventServiceProvider.php, don't forget to import the new event and listeners.

use App\Events\ProductPurchased; 
use App\Listeners\AwardAchievements;
use App\Listeners\SendShareableCoupon;
use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Event;

This would be irrelevant once you turn on shouldDiscoverEvents method though.

Activity icon

Commented on Eventing Pros And Cons

yup same problem. Please let me know if you fixed it. Thanks :)

Activity icon

Commented on Notifications Versus Mailables

Thank you!

Oct
16
5 months ago
Activity icon

Commented on Send Raw Mail

Thanks a lot :)

Activity icon

Commented on Send Raw Mail

Thanks!

Oct
14
5 months ago
Activity icon

Commented on Forms That Submit PUT Requests

for those using the URL method

<form action="{{url('/articles/' . $article->id)}}" method="POST">
Oct
13
5 months ago
Activity icon

Commented on Render Dynamic Data

thanks! i just used $article_1->excerpt = $faker->sentence(20);

Oct
12
5 months ago
Activity icon

Commented on Display All Tags Under Each Article

For those getting Invalid argument supplied for foreach() (View: C:\xampp\htdocs\Laravel\Proj_2\resources\views\articles\index.blade.php)

make sure your Tag model has:

public function articles{} // PLURAL

it has to match the if statement in ArticlesController:

if (request('tag')){
        $articles = Tag::where('name', request('tag'))->firstOrFail()->articles;  // PLURAL
Oct
11
6 months ago
Activity icon

Commented on Understanding Foreign Keys And Database Factories

Try exiting php artisan tinker (Ctrl + C), then go back in and run Article::factory(5)->create(); again. Worked for me.

Activity icon

Commented on Understanding Foreign Keys And Database Factories

This worked! Thanks a lot. The code in UserFactory.php in the video (laravel 6) is different from laravel 8.