creativetimofficial / ct-argon-dashboard-pro-laravel

Argon Pro Dashboard For Laravel Framework 11.x and Up
http://argon-dashboard-pro-laravel.creative-tim.com/
32 stars 13 forks source link

No navigation between pages on fresh installation [Premium Support] #14

Closed nereauweb closed 4 years ago

nereauweb commented 4 years ago

Hello, I installed Argon Pro Theme For Laravel Framework on a Centos7 machine (clean install), following the getting started instructions. Everything seems fine, but I can't navigate the pages (except the very first), or login: I always get a page not found error. (Also, I can't cache my routes, but this seems to depend from the using of closures). Here is my routes/web.php page:

`Route::get('/', function () { return view('pages.welcome'); })->name('welcome');

Auth::routes();

Route::get('dashboard', 'HomeController@index')->name('home'); Route::get('pricing', 'PageController@pricing')->name('page.pricing'); Route::get('lock', 'PageController@lock')->name('page.lock');

Route::group(['middleware' => 'auth'], function () { Route::resource('category', 'CategoryController', ['except' => ['show']]); Route::resource('tag', 'TagController', ['except' => ['show']]); Route::resource('item', 'ItemController', ['except' => ['show']]); Route::resource('role', 'RoleController', ['except' => ['show', 'destroy']]); Route::resource('user', 'UserController', ['except' => ['show']]);

Route::get('profile', ['as' => 'profile.edit', 'uses' => 'ProfileController@edit']);
Route::put('profile', ['as' => 'profile.update', 'uses' => 'ProfileController@update']);
Route::put('profile/password', ['as' => 'profile.password', 'uses' => 'ProfileController@password']);

Route::get('{page}', ['as' => 'page.index', 'uses' => 'PageController@index']);

}); `

I also have another question (not exactly a bug): what's the best way to implement the theme in an existing laravel web app? (Current buggy installation aims to let me play in order to get that aim in the end)

Thanks Andrea

teamupdivision commented 4 years ago

Hello, @nereauweb. Thank you for using our products. We could not reproduce the issues you have reported. Can you please let us know the exact steps you took to install the project?

Thank you

nereauweb commented 4 years ago

Hello, I tried again, this time with non-root user, with same result. I use Apache on Linux CentOs7. What I did was:

Got the reported error at this stage

Route cache cleared!

LogicException : Unable to prepare route [api/user] for serialization. Uses Closure.

at /var/www/wope.test/vendor/laravel/framework/src/Illuminate/Routing/Route.ph p:917 913| */ 914| public function prepareForSerialization() 915| { 916| if ($this->action['uses'] instanceof Closure) {

917| throw new LogicException("Unable to prepare route [{$this-> uri}] for serialization. Uses Closure."); 918| } 919| 920| $this->compileRoute(); 921|

Exception trace:

1 Illuminate\Routing\Route::prepareForSerialization() /var/www/wope.test/vendor/laravel/framework/src/Illuminate/Foundation/Cons ole/RouteCacheCommand.php:62

2 Illuminate\Foundation\Console\RouteCacheCommand::handle() /var/www/wope.test/vendor/laravel/framework/src/Illuminate/Container/Bound Method.php:32

Please use the argument -v to see more details.

Still same error. Which is: I can only see the very first page, but can't navigate to any. If I change the / page in the route I get to see it, but again, not to navigate to the others. Result is always:

Not Found The requested URL /login was not found on this server.

nereauweb commented 4 years ago

I also have a runnin laravel project, my final goal is to use there the template. Could you please suggest the best way to achieve that?

nereauweb commented 4 years ago

I also report my http .conf, is the same configuration (apart for URLs and Path) I use in my other working Laravel project on the same machine:

<VirtualHost *>
    DocumentRoot "/var/www/wope.test/public/"
    ServerName test.wope.it
    <Directory "/var/www/wope.new/public/">
        Options FollowSymLinks
        ReWriteEngine On
                AllowOverride All
                Require all granted
    </Directory>
</VirtualHost>
nereauweb commented 4 years ago

Sorry, my fault! I left the directory reference to the other project's path... so the problem was not in the code or permission, where I was looking in vain, but in the .conf. Working now.

(I still would appreciate some insight on importing the template to an existing project, if possibile)

Thanks

teamupdivision commented 4 years ago

Hello @nereauweb I'm really glad you solved the issue. For the template import to an existing project, do you want to import just the template or the Laravel part also?

nereauweb commented 4 years ago

The template with the elements (charts, forms, some widget, etc.). The Laravel (functional) part is already built, mostly using Bootstrap and Datatables for visualizations. I already tried applying the argon css with good result, but I’d like to understand more before applying the rest, to do it the right way. (I’m familiar with PHP and plain HTML/ CSS / Javascript, not so much with assets, vue.js, etc)

Thanks

teamupdivision commented 4 years ago

Generally speaking you need to import all of the files from the public folder to your project resources and start using the CSS / Javascript files If in the blade files you need to add new content sections or updates, make sure to use directly HTML content from the Creative Tim template files - that is the best way to take advantage of them.

All the best