mercredi 22 janvier 2020

Laravel retrieving data only for selected id

Currently i have app builded using: - Models - Keyword - Video - Repositories - VideoRepository - KeywordRepository - Controllers - VideoController - KeywordController Keyword and Video is pivoted

In KeywordController i would like to display Keywordlist only for selected video_id.


namespace App\Http\Controllers;

use Illuminate\Http\Request;

use App\Models\Keyword;

use App\Repositories\KeywordRepository;

class KeywordController extends Controller
{
    public function index(KeywordRepository $keywordRepo, $video_id){

        $keywords = $keywordRepo->getAll();

        dump($keywords);


    }

At this moment i can't use find($video_id). Is there any way to use VideoRepository for retrieving correct video and than retrieve $keywordRepo elements for it?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire