Skip to content

Commit

Permalink
chore: remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
itsrafsanjani committed Apr 18, 2024
1 parent 072d15c commit 6231052
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 24 deletions.
4 changes: 2 additions & 2 deletions app/Http/Controllers/Backend/VideoController.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public function update(UpdateVideoRequest $request, Video $video)
$video->update($request->validated());

// redirect
session()->flash('message', 'VideoRule updated');
session()->flash('message', 'Video updated');
session()->flash('type', 'success');
return redirect()->route('videos.index');
}
Expand All @@ -125,7 +125,7 @@ public function destroy(Video $video)
Storage::delete($video->video);

$video->delete();
session()->flash('message', 'VideoRule deleted');
session()->flash('message', 'Video deleted');
session()->flash('type', 'success');
return redirect()->back();
}
Expand Down
4 changes: 0 additions & 4 deletions app/Http/Controllers/Frontend/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@ public function index()
->get();
});

// $data['newVideos'] = VideoRule::where('status', 1)->select('id', 'slug', 'title', 'imdb_rating', 'type', 'genres', 'poster')->latest()->take(5)->get();
// $data['popularVideos'] = VideoRule::where('status', 1)->orderBy('views', 'desc')->select('id', 'slug', 'title', 'imdb_rating', 'type', 'genres', 'poster')->take(10)->get();
// $data['videos'] = VideoRule::where('status', 1)->select('id', 'slug', 'title', 'imdb_rating', 'type', 'genres', 'poster')->paginate(18);
return view('frontend.frontend', $data);
// return $data;
}

public function aboutUs()
Expand Down
8 changes: 0 additions & 8 deletions app/Http/Controllers/Frontend/VideoController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,6 @@ public function show($slug)
$data['video']->increment('views');
}

// $videoGenres = !empty($data['video']['genres']);
//
// $data['similarVideos'] = VideoRule::where('genres', 'LIKE', '%' . $videoGenres . '%')
// ->select('id', 'slug', 'title', 'imdb_rating', 'type', 'genres', 'poster')
// ->orderBy('views', 'desc')
// ->take(6)
// ->get();

//Collection in php is maybe flexible for push, pop or similar operation.
$data['similarVideos'] = collect();

Expand Down
5 changes: 0 additions & 5 deletions database/factories/CommentFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ class CommentFactory extends Factory
*/
public function definition()
{
// $comment = Comment::factory()
// ->count(3)
// ->for(User::factory()->count(10))
// ->for(VideoRule::factory()->count(10))
// ->create();
return [
'user_id' => User::all()->random()->id,
'video_id' => Video::all()->random()->id,
Expand Down
3 changes: 0 additions & 3 deletions database/seeders/CommentsTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ class CommentsTableSeeder extends Seeder
*/
public function run()
{
// Comment::factory(10)->create();
Comment::factory(10)
// ->has(User::factory()->count(10))
// ->has(VideoRule::factory()->count(10))
->create();
}
}
2 changes: 1 addition & 1 deletion database/seeders/DatabaseSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function run()
]);

// User::factory(10)->create();
// VideoRule::factory(10)->create();
// Video::factory(10)->create();
$this->call(GeneratedVideosTableSeeder::class);
Review::factory(10)->create();
Comment::factory(10)->create();
Expand Down
1 change: 0 additions & 1 deletion database/seeders/VideosTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class VideosTableSeeder extends Seeder
*/
public function run()
{
// VideoRule::factory(50)->create();
Video::factory()
->count(3)
->for(User::factory())
Expand Down

0 comments on commit 6231052

Please sign in to comment.