⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Laravel 5.5 problems



st28

st28
  • profile picture
  • Member

Posted 05 September 2017 - 16:19 PM

Hi,

we bought the enterprise edition to use it with latest Laravel 5.5.

We had initial problems after installing with or without composer where it could not find the GroceryCrud class. The namespace location registered by composer was as -

'GroceryCrud' => array($vendorDir . '/grocerycrud/enterprise/src')

Whereas the folder structure we got was "vendor/grocerycrud/enterprise/grocery-crud-enterprise-v2/src"

 

After fixing the locaiton the class not found got fixed and we were able to get the employee table rendered as expected.

 

However, if we try to edit, delete or basically do any type of post we get "Method Not Allowed" error as its not defined in the Routes I presume ?

Should this be working out of the box or I should be defining routes and handling response data manually, I am struggling to find laravel specific examples ?

Also should I be adding {{ csrf_field() }} somewhere in the view to avoid token mismatch ?

 

Can you please help.

Thanks!

 


st28

st28
  • profile picture
  • Member

Posted 07 September 2017 - 20:14 PM

Hi, can anyone help with the above, Thanks!


web-johnny

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 08 September 2017 - 03:17 AM

Hello @st28,

 

For your questions:
 

1. Make sure that your route accepts get and post (the most common issue is that the routes doesn't accept the post)
2. Add the token with the instructions of laravel here: https://laravel.com/docs/5.4/csrf#csrf-x-csrf-token so basically:

add this to your JavaScript:

 

$.ajaxSetup({
    headers: {
        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
    }
});

and make sure that you have the meta tag at your template:

 

<meta name="csrf-token" content="{{ csrf_token() }}"> 

Regards

Johnny


st28

st28
  • profile picture
  • Member

Posted 21 September 2017 - 09:14 AM

Hi and thanks for your response. I managed to get the csrf token issue sorted and also Delete now works but when I try edit, it gives me below. Is it to do with PHP 7 ?

 

 

    "message": "A non well formed numeric value encountered",
    "file": "/Volumes/Developer/Projects/mast-v2/vendor/zendframework/zend-db/src/Adapter/Driver/Pdo/Statement.php",
    "line": 293,

st28

st28
  • profile picture
  • Member

Posted 21 September 2017 - 11:22 AM

Fixed it by following response from here -

https://github.com/zendframework/zend-db/issues/208


web-johnny

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 24 June 2018 - 04:54 AM

Hello guys, in case you are interested we are now having an official detailed guideline of how to install Grocery CRUD Enterprise to your Laravel project:

https://www.grocerycrud.com/enterprise/enterprise-documentation/laravel-installation


sudhakar

sudhakar
  • profile picture
  • Member

Posted 16 August 2018 - 09:36 AM

hi i am using laravel 5.6. i want to use grocerycurd in my project.

 

From using installation steps https://www.grocerycrud.com/enterprise/enterprise-documentation/laravel-installation 

from the above link. I am unable to get grocery-crud-enterprise-v2.3.7.zip 

 

Also while installation i getting below error

 

Problem 1
    - The requested package grocerycrud/enterprise could not be found in any ver
sion, there may be a typo in the package name.
 
Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your min
imum-stability setting
ails.
 - It's a private package and you forgot to add a custom repository to find it
 
n problems.

 

please can anyone help me how to integrate the grocery crud in my project