jadjoubran / laravel5-angular-material-starter

Get started with Laravel 5.3 and AngularJS (material)
https://laravel-angular.readme.io/
MIT License
1.66k stars 400 forks source link

Not working together with admin packages like Voyager? #434

Closed mgvd closed 7 years ago

mgvd commented 7 years ago

All works fine when I use a vanilla laravel application with Voyager.

Iḿ new to Laravel and Laravel-material; maybe there is an obvious sollution. Please let me know.

mgvd commented 7 years ago

Hold on. Will try again using --save

jadjoubran commented 7 years ago

Hi @mgvd Any update on this issue?

mgvd commented 7 years ago

No, I gave up to be honest. If someone confirms that either Voyager should or should not work together with ang-matr., that would be useful

jadjoubran commented 7 years ago

Could you try going to app\Http\Controllers\Controller.php and try making the function look like this:

        if ($validator->fails()) {
               throw new ValidationException($this); 
        }

Basically I just removed this check: Route::current()->getPrefix() === 'api'

Let me know if it fixes the issue

followtheart commented 7 years ago

Voyager works with this starter without any modification of this project 😄 But in my case,my user table conflicts with voyager's default user table;your may have some problem like that too

mgvd commented 7 years ago

@jadjoubran this doesn't work. same behaviour.

@followtheart I'm very curious how your install is different. After initiating a new laravel-material-starter application, fixing the .env I do the stuff mentioned here: https://github.com/the-control-group/voyager

followtheart commented 7 years ago

laravel5-angular-material-starter-voyager

you can use this https://github.com/followtheart/laravel5-angular-material-starter-voyager.git directly, Or you can do it yourself, just follow steps below:

Step 1, laravel5-starter

Also see here :https://laravel-angular.readme.io/docs

git clone https://github.com/jadjoubran/laravel5-angular-material-starter.git
cd laravel5-angular-material-starter
npm install -g gulp bower
npm install
bower install
#fix database credentials in .env
php artisan migrate
gulp

Step 2, voyager

Also see here: https://github.com/the-control-group/voyager

composer require tcg/voyager

Next make sure to create a new database and add your database credentials to your .env file:

DB_HOST=localhost
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

Add the Voyager service provider to the config/app.php file in the providers array:

'providers' => [
    // Laravel Framework Service Providers...
    //...

    // Package Service Providers
    TCG\Voyager\VoyagerServiceProvider::class,
    // ...

    // Application Service Providers
    // ...
],

Lastly, we can install voyager by running

php artisan voyager:install

extra steps:

##(ONLY IN STARTER!!)  
php artisan migrate:refresh
php artisan db:seed --class=VoyagerDatabaseSeeder

run server

php artisan serve 
jadjoubran commented 7 years ago

@mgvd any updates? @followtheart thank you so much for your contributions 😄