Giter VIP home page Giter VIP logo

Comments (15)

mzummo avatar mzummo commented on June 1, 2024

if i inject the modal instead of the repo i get a different error about not being to find query builder :: store

everything else is going smoothly with the template ;)

from laravel-boilerplate.

adr1enbe4udou1n avatar adr1enbe4udou1n commented on June 1, 2024

Hey bro,
Just go to your AppServiceProvider and you'll find out missing binding ;)

from laravel-boilerplate.

mzummo avatar mzummo commented on June 1, 2024

i added this, but i still get the same error:

    $this->app->bind(
        CourtCaseRepository::class,
        EloquentCourtCaseRepository::class
    );

from laravel-boilerplate.

mzummo avatar mzummo commented on June 1, 2024

Contracts\CourtCaseRepository.php :

namespace App\Repositories\Contracts;

use App\Models\CourtCase;

interface CourtCaseRepository
{
/**
* @return \Illuminate\Database\Query\Builder
*/
public function get();

/**
 * @param $locale
 * @param $route
 *
 * @return Meta
 */
public function find($locale, $route);

/**
 * @param $input
 *
 * @return mixed
 */
public function store($input);

/**
 * @param Meta $meta
 * @param $input
 *
 * @return mixed
 */
public function update(CourtCase $courtCase, $input);

/**
 * @param Meta $meta
 *
 * @return mixed
 */
public function destroy(CourtCase $courtCase);

/**
 * @param \App\Models\Meta $meta
 *
 * @return mixed
 */

}

from laravel-boilerplate.

mzummo avatar mzummo commented on June 1, 2024

CaseController.php:

namespace App\Http\Controllers\Backend;

use App\Http\Controllers\Controller;
use App\Http\Requests\StoreUserRequest;
use App\Http\Requests\UpdateUserRequest;
use App\Models\User;
use App\Repositories\Contracts\RoleRepository;
use App\Repositories\Contracts\UserRepository;

use App\Models\CourtCase;
use App\Repositories\Contracts\CourtCaseRepository;
use App\Http\Requests\StoreCourtCaseRequest;

use Illuminate\Http\Request;
use Yajra\Datatables\Datatables;
use Yajra\Datatables\Engines\EloquentEngine;
use Yajra\Datatables\Html\Builder;

class CaseController extends Controller
{

protected $courtCase;

/**
 * @var UserRepository
 */
protected $users;

/**
 * @var RoleRepository
 */
protected $roles;

/**
 * Datatables Html Builder.
 *
 * @var Builder
 */
protected $htmlBuilder;

/**
 * Create a new controller instance.
 *
 * @param UserRepository                             $users
 * @param \App\Repositories\Contracts\RoleRepository $roles
 * @param Builder                                    $htmlBuilder
 */
public function __construct(UserRepository $users, CourtCaseRepository $courtCase, RoleRepository $roles, Builder $htmlBuilder)
{
    $this->users = $users;
    $this->courtCase = $courtCase;
    $this->roles = $roles;
    $this->htmlBuilder = $htmlBuilder;
}

from laravel-boilerplate.

adr1enbe4udou1n avatar adr1enbe4udou1n commented on June 1, 2024

Are you sure you have import CourtCaseRepository in your AppServiceProvider ?
By the way dont use the old 2.4 release, just take master branch

from laravel-boilerplate.

mzummo avatar mzummo commented on June 1, 2024

the master branch is nice, but i can't add on learning vue at the moment =/ otherwise i would. (do you have a non vue version of master?)

from laravel-boilerplate.

mzummo avatar mzummo commented on June 1, 2024

i can also fork the git repo and show you my changes thus far

from laravel-boilerplate.

adr1enbe4udou1n avatar adr1enbe4udou1n commented on June 1, 2024

Okay for fork it will be simpler i guess ^^
But it should work if you have correct bindings

from laravel-boilerplate.

mzummo avatar mzummo commented on June 1, 2024

code is up at: https://github.com/mzummo/laravel-boilerplate/tree/dev github cant compare across the forks (that i know) ... i use beyond compare .... i know its going to be something super simple :P

from laravel-boilerplate.

adr1enbe4udou1n avatar adr1enbe4udou1n commented on June 1, 2024

This is i was thinking ;)
You just forgot to import CourtCaseRepository here (use statements) :
https://github.com/mzummo/laravel-boilerplate/blob/dev/app/Providers/AppServiceProvider.php

from laravel-boilerplate.

mzummo avatar mzummo commented on June 1, 2024

almost there!: Type error: Argument 1 passed to App\Http\Controllers\Backend\CaseController::__construct() must implement interface App\Repositories\Contracts\CourtCaseRepository, instance of App\Repositories\EloquentCourtCaseRepository given

from laravel-boilerplate.

mzummo avatar mzummo commented on June 1, 2024

updated github

from laravel-boilerplate.

adr1enbe4udou1n avatar adr1enbe4udou1n commented on June 1, 2024

Commented out your find method :
https://github.com/mzummo/laravel-boilerplate/blob/dev/app/Repositories/EloquentCourtCaseRepository.php

from laravel-boilerplate.

mzummo avatar mzummo commented on June 1, 2024

think i got it: class EloquentCourtCaseRepository extends BaseRepository implements CourtCaseRepository needed to add impliments ...

now to get it to write to the DB

from laravel-boilerplate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.