tastemedia

tastemedia

Member Since 2 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 Your Engines Achievement

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • First Thousand Achievement

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • One Year Member Achievement

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • Two Year Member Achievement

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • Three Year Member Achievement

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • Four Year Member Achievement

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • Five Year Member Achievement

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • School In Session Achievement

    School In Session

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

  • Welcome To The Community Achievement

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • Full Time Learner Achievement

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • Pay It Forward Achievement

    Pay It Forward

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

  • Subscriber Achievement

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • Lifer Achievement

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • Laracasts Evangelist Achievement

    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 Achievement

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • Laracasts Veteran Achievement

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • Ten Thousand Strong Achievement

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • Laracasts Master Achievement

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • Laracasts Tutor Achievement

    Laracasts Tutor

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

  • Laracasts Sensei Achievement

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • Top 50 Achievement

    Top 50

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

20 May
12 hours 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
4 days 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
1 month 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
2 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.