Category : repository

I know that this question was asked so many times, but none of answers helped me. I’m getting exception in Laravel 5.8: Target [AppRepositoriesCategoryCategoryRepositoryInterface] is not instantiable while building [AppHttpControllersAdminCategoryController, AppServicesCategoryServices]. What I’ve done without success: Register AppProvidersRepositoryServiceProvider in providers Structure: app – Repositoties – CategoryRepository.php – CategoryRepositoryInterface.php – Models – CategoryModel.php – Providers – ..

Read more

i´m traying to create and use one personaliced class and use Laravel´s repository. For this, i was created a UpdateVisualizationsRequest and CreateVisualizationRequest also VisualizationRepository. his content it´s: UpdateVisualizationsRequest: <?php namespace AppHttpRequests; use IlluminateFoundationHttpFormRequest; use AppModelsVisualization; class UpdateVisualizationRequest extends FormRequest { /** * Determine if the user is authorized to make this request. * * @return ..

Read more

How could I make this sql query with the doctrine like this: return $this->createQueryBuilder(‘l’) ->select(‘l.fecha as fecha l.id as idLectura,s.id as Servidor,l.serial as serial ,m.id as idMaquina,t.nombre as nombreMaquina’) ->join(‘l.idServidor’,’s’) ->join(‘l.idMaquina’,’m’) ->join(‘m.tipo’,’t’) ->andWhere(‘m.codCentro = :val1’) ->setParameter(‘val1’,$codCentro) ->orderBy(‘l.fecha’, ‘DESC’) ->groupby(‘t.nombre’) ->getQuery() ->getResult(); And I want to do the same with this MySQL query: SELECT Tipo_Maquina.nombre, Lectura_Componentes.id_maquina, ..

Read more

This is a part of my entity Competence : class Competence { /** * @ORMId() * @ORMGeneratedValue(strategy="IDENTITY") * @ORMColumn(type="integer") * @Groups("competence") */ private $id; /** * @ORMColumn(type="string", length=255) * @Groups("competence") */ private $libelle; /** * @ORMManyToMany(targetEntity=Competence::class, mappedBy="dependsDe") */ private $includes; /** * @ORMManyToMany(targetEntity=Competence::class, inversedBy="inclus") * @ORMJoinTable(name="competenceDependance", * joinColumns={@ORMJoinColumn(name="competence_id", referencedColumnName="id")}, * inverseJoinColumns={@ORMJoinColumn(name="competence_dependante_id", * referencedColumnName="id")} * ) ..

Read more

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