Question: We Have Had An Error Error 500

We Have Had An Error Error 500

Hello, I have an error while installing the laravel app, firstly the link opened sbm.optikaas.com/install I followed the steps by entering the database name that I've created the username an

G

Gent

Asked

Hello, I have an error while installing the laravel app, firstly the link opened sbm.optikaas.com/install I followed the steps by entering the database name that I’ve created the username and pass, and then I had an error sql prompting it could not found the table optikaas_bm.users, then i checked the database where the table was created with the name tec_users and all the other tables had the same prefix tec_. I removed the prfixes in each table the installation completed but then the error appeared ERROR 500.

I checked the error_log it was clear, I also checked storage_logs . I added the log in attachment i think a file named settings.json is missing. but anyways i hope to hear from you asap.

P.S all the versions meet the required ones.

Attachments
  • MS

    Mian Saleem

    Answered

    Hello,

    Have you downloaded the file recently? As I remember the prefix and settings file issues were fixed 😦

    Not sure about removing the prefix. If there is any issue later, you can set the prefix int the config/database.php

    You can create storage/app/settings.json with following contents

    {
        "demo": false,
        "stock": false,
        "ac": {
            "rows": "25",
            "sideBarStyle": "1",
            "dateformat": "DD\/MM\/YYYY",
            "noRows": "10",
            "idColumn": true,
            "navPosition": "left",
            "short_name": "SBM",
            "select": false,
            "country": {
                "value": "BD",
                "label": "Bangladesh"
            }
        },
        "baseURL": "http:\/\/sbm.test",
        "app": {
            "name": "Business Manager"
        },
        "system": {
            "card_gateway": null,
            "default_account_id": null
        }
    }
    

    Thank you

  • G

    Gent

    Answered

    i bough it last year and i downloaded the file like 3 days ago, maybe that file didn’t get updated like the rest of the newer bought files anyways i made the changes and now its working fine, one last question, at the invoice and while creating customers in the state area i don’t see the capital city of my country Macedonia, i only see other cities located in that country where can i add the missing cities ?

  • G

    Gent

    Answered

    i also get this error in email templates 500 Internal Server Error ill send u log in attachment.

  • MS

    Mian Saleem

    Answered

    Hello,

    I used menarasolutions/geographer-laravel for the countries and cities.

    The helpers were removed after v6 and I recently updated to Laravel 8 and missed this. I will fix this soon.

    Thank you

  • MS

    Mian Saleem

    Answered

    Hello,

    It you need it urgent then please edit app/Http/Controllers/EmailTemplateController.php and replace the contents with following

    <?php
    
    namespace App\Http\Controllers;
    
    use App\Company;
    use Illuminate\Support\Str;
    use Illuminate\Http\Request;
    
    class EmailTemplateController extends Controller
    {
        public function show($template = 'user_created')
        {
            $view = $this->{Str::camel($template)}();
            return response()->json([
                'footer'   => Str::after($view, '<!-- Template End -->'),
                'header'   => Str::before($view, '<!-- Template Start -->'),
                'template' => trim(Str::before(Str::after($view, '<!-- Template Start -->'), '<!-- Template End -->')),
            ]);
        }
    
        public function update(Request $request, $template = 'user_created')
        {
            if (demo()) {
                return response(['message' => 'This feature is disabled on demo.'], 422);
            }
            $path = resource_path('views/' . $this->{Str::camel($template)}(true) . '.blade.php');
            $data = "@extends('mail.template')\n@section('content')\n" . $request->template . "\n@endsection\n";
            return response()->json(['success' => file_put_contents($path, $data), 'template' => $request->template]);
        }
    
        private function invoiceCreated($view = false)
        {
            if ($view) {
                return 'mail/invoice/created';
            }
            $data = [
                'company'          => \App\Company::first(),
                'grand_total'      => '{{$grand_total}}',
                'invoice_url'      => '{{$invoice_url}}',
                'customer_name'    => '{{$customer_name}}',
                'invoice_number'   => '{{$invoice_number}}',
                'customer_company' => '{{$customer_company}}',
            ];
            return view('mail.invoice.created', $data);
        }
    
        private function paymentCreated($view = false)
        {
            if ($view) {
                return 'mail/payment/created';
            }
            $data = [
                'amount'          => '{{$amount}}',
                'customer'        => '{{$customer}}',
                'company'         => Company::first(),
                'payment_url'     => '{{$payment_url}}',
                'payable_name'    => '{{$payable_name}}',
                'payment_number'  => '{{$payment_number}}',
                'payable_company' => '{{$payable_company}}',
            ];
            return view('mail.payment.created', $data);
        }
    
        private function paymentReceived($view = false)
        {
            if ($view) {
                return 'mail/payment/received';
            }
            $data = [
                'amount'                 => '{{$amount}}',
                'gateway'                => '{{$gateway}}',
                'customer'               => '{{$customer}}',
                'company'                => Company::first(),
                'payment_url'            => '{{$payment_url}}',
                'payable_name'           => '{{$payable_name}}',
                'payment_number'         => '{{$payment_number}}',
                'payable_company'        => '{{$payable_company}}',
                'gateway_transaction_id' => '{{$gateway_transaction_id}}',
            ];
            return view('mail.payment.received', $data);
        }
    
        private function purchaseCreated($view = false)
        {
            if ($view) {
                return 'mail/purchase/created';
            }
            $data = [
                'company'         => Company::first(),
                'grand_total'     => '{{$grand_total}}',
                'vendor_name'     => '{{$vendor_name}}',
                'purchase_url'    => '{{$purchase_url}}',
                'vendor_company'  => '{{$vendor_company}}',
                'purchase_number' => '{{$purchase_number}}',
            ];
            return view('mail.purchase.created', $data);
        }
    
        private function userCreated($view = false)
        {
            if ($view) {
                return 'mail/user/created';
            }
            $data = [
                'name'      => '{{ $name }}',
                'email'     => '{{ $email }}',
                'username'  => '{{ $username }}',
                'password'  => '{{ $password }}',
                'login_url' => '{{ $login_url }}',
                'company'   => Company::first(),
            ];
            return view('mail.user.created', $data);
        }
    
        private function userReset($view = false)
        {
            if ($view) {
                return 'mail/user/reset';
            }
            $data = [
                'name'      => '{{ $name }}',
                'email'     => '{{ $email }}',
                'username'  => '{{ $username }}',
                'password'  => '{{ $password }}',
                'login_url' => '{{ $login_url }}',
                'company'   => Company::first(),
            ];
            return view('mail.user.reset', $data);
        }
    }
    
    
  • Login to Reply