tastemedia

tastemedia

Member Since 4 Months Ago

Experience Points 430
Experience Level 1

4,570 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 0
Lessons
Completed
Best Reply Awards 0
Best Reply
Awards
  • start-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-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-token Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer-token Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • lara-evanghelist 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.

20 May
1 month ago

tastemedia left a reply on Many-to-many Not Getting Tag Names

@DEVFREY - thx a lot. this works perfectly. my bad. i was totally on the wrong way....cheers

tastemedia started a new conversation Many-to-many Not Getting Tag Names

Hi there, i´m having problems receiving the tag names belonging to a videopost.

my model for videofiles

class Videofiles extends Model
{

    public function tags() {
        
        return $this->belongsToMany('App\Tag');
     
    }

}

my model for Tag

class Tag extends Model
{

    public function videofiles() 
    {

        return $this->belongsToMany('App\Videofiles');  
  
    }


}


i´ve a pivot table with videofiles_id and tag_id where the id´s are saved proberly in relation to the videofiles id. i want to show the tag names in my blade template. how can i manage this? can somebody explain it to me, how to achieve this?

any help appreciated. thx in advance.

16 May
2 months ago

tastemedia left a reply on Error On Migration

@kuns25 thx for your help. i fixed it already!

tastemedia left a reply on Error On Migration

@nakov thx a lot for your help. i could fix this now. the problem i had was different signing definition on tag id in tags table.

tastemedia left a reply on Error On Migration

@nakov yes i did the migration for tags first.

tastemedia left a reply on Error On Migration

@nakov first thx for your reply. Yes, i have this:

Schema::create('tags', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->text('name'); 
            $table->timestamps();
        });

tastemedia started a new conversation Error On Migration

Hi there, i´m getting an error when i want to do migration.

Illuminate\Database\QueryException : SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (SQL: alter table tag_videofile add constraint tag_videofile_tag_id_foreign foreign key (tag_id) references tags (id))

here´s my migration file:


class CreateTagVideofileTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('tag_videofile', function (Blueprint $table) {
            $table->unsignedBigInteger('videofile_id');
            $table->foreign('videofile_id')->references('id')->on('videofiles');
            $table->unsignedBigInteger('tag_id');
            $table->foreign('tag_id')->references('id')->on('tags');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('tag_videofile');
    }


what i´m doing wrong here? Ccan someone help me out? thx in advance.

17 Apr
3 months ago

tastemedia left a reply on How To Paginate Posts From Category

yes Sergiu17, this is works perfect. thx a lot for your help.

tastemedia started a new conversation How To Paginate Posts From Category

Hi, im not sure how to make this in a correct way

i get all posts related to my category but don´t know how paginate the results: here my category controller:

class CategoryController extends Controller
{
    public function show(Category $category) {
        
        return view('posts.category', compact('category'));

    }

}

my category model:

class Category extends Model {

    protected $table = 'categories';

    public function posts() {   
      
      return $this->hasMany('App\Post', 'category_id');
      
    }

    public function getRouteKeyName() {

      return 'name';

    }
  
}

the blade template:

...
@foreach($category->posts as $post)

        <div class="col-md-4">
                <div class="card mb-4 shadow-sm">
                <a href="/post/{{ $post->slug }}">  
                    <img src="{{ Voyager::image( $post->image ) }}" style="width:100%">
                    <div class="card-body">
                        <h1 class="card-text">{{ $post->title }}</h1>
                    </a>    
                        <p><span>{{ $post->created_at->format('d'."." . 'm' . "." . 'Y') }}</span></p>
                        <p><span class="badge badge-info">{{ $post->category->name }}</span>
                        <span class="badge badge-warning ">free content</span></p>
                    </div>
                </div>      
            </div> 
        @endforeach
...

Any help appreciated, thanks in advance.

18 Mar
4 months ago

tastemedia left a reply on How To Use Yoyager Permissions In Frontend

thanks a lot for your help!

tastemedia started a new conversation How To Use Yoyager Permissions In Frontend

Hi there, i´m new to laravel and i´m using Voyager for admin. I´m stuck at the moment and wonder how can i use the user permissions from voyager to show or hide posts in the frontend based on the specific roles and permissions in voyager.

Any hint how to accomplish this? thanks in advance.