0

I have two traits file with the same class:

app/Traits/OperationTools_OLD.php
app/Traits/OperationTools.php

The two files contain the same class name like the following:

<?php
namespace App\Traits;

use Carbon\Carbon;
use App\Http\Helpers\FoxUtils;
use App\Operation;


trait OperationTools {
    use \App\Traits\CavityTools;
   
    public function getProduction(...

The app does not recognize the code of the new file OperationTools.php and it looks to execute the code of the old one.

I have tried to change the trait name of the old file to be trait OperationTools_OLD, but now I get the error when I try to use it:

Trait 'App\Traits\OperationTools' not found

I think that there is what is like, a class file map, in the app that should be refreshed but I don't know how?

I have tried artisan config:clear, view:clear but the issue is the same.

I'm using and on Ubuntu and Apache.

2
  • 3
    I think you must let composer create a new autoload file. Run composer dump-autoload for that. Commented Dec 16, 2021 at 14:17
  • @GisoStallenberg Yes it is. Thank you. Commented Dec 16, 2021 at 14:33

1 Answer 1

3

Run composer dump-autoload to create a new autoload file

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.