Category : repository

I’ve read about repository pattern.So, I created UserRepositoryInterface.php file namespace AppInterfaces; use PrettusRepositoryContractsRepositoryInterface; interface UserInterface extends RepositoryInterface { // Code } Then I created UserRepository.php: <?php namespace AppRepositories; use PrettusRepositoryEloquentBaseRepository; use AppInterfacesUserInterface; class UserRepository extends BaseRepository implements UserInterface { public function model() { return User::class; } } Finally, I bind interface to class in RepositoryServiceProvider.php ..

Read more

I have an idea to store a newsfeed and I would like a little help. For example, I want to make a NewsFeedRepository and in it to call what change from the related functions. DeveloperNews::create([ ‘news’ => $request[‘news’], ‘developer_id’ => Auth::user()->id, ‘project_id’ => $project_id, ‘publish’ => 0, ‘first_name’ => Auth::user()->first_name, ‘last_name’ => Auth::user()->last_name ]); -> ..

Read more