wish help you to fix your issue AES has a fixed block size of 128 bit and supports key sizes of 128, 192 and 256 bit. It does not support key sizes of 512 bit (64 byte). Rijndael, which AES is based on, supports block sizes of 128, 192 and 256 bit with the same key sizes as AES. If you're using system/libraries/Encrypt.php, then you're using Rijndael-256 (default; not AES, because the block size (256) is different) with a key size of 256 bit. Every "key" that you pass in will be hashed with MD5 which is actually only 128 bit in size, but it is Hex-encoded and therefore needlessly inflated to 256 bit without extra security. Needless to say, this is rather old and should never be used anymore.
this will help AES keys need to be indistinguishable from random and either 16, 24 or 32 bytes in length. It seems Laravel adds an additional check for the AES key to be a valid size. Basically what the PHP's mcrypt does (not sure about the C-code) is that it extends the key data with 00 valued bytes if the key is smaller than 32 bytes, until it gets to the first legal AES key size. If the key is larger than 32 bytes it simply cuts it to 32 bytes. This is absolutely against any good practice with regards to handling keys.
AES/CCM Encryption and Plaintext Length Exceeds Maximum Message Length