[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: Test.php
<?php /** -------------------------------------------------------------------------------- * This controller manages all the business logic for template * * @package Grow CRM * @author NextLoop *----------------------------------------------------------------------------------*/ namespace App\Http\Controllers\Landlord; use App\Http\Controllers\Controller; use Log; // use Illuminate\Validation\Rule; // use Validator; class Test extends Controller { public function __construct() { //parent parent::__construct(); //authenticated $this->middleware('auth'); } /** * @return blade view | ajax view * - position 11 | 21 | 31 | 41 | 51 | 61 | 71 * - datatype text date paragraph checkbox dropdown number decimal * - limit 10 * - task client project * */ public function index() { //get the customer from landlord db $customers = \Spatie\Multitenancy\Models\Tenant::get(); foreach ($customers as $customer) { \Spatie\Multitenancy\Models\Tenant::forgetCurrent(); try { //swicth to this tenants DB $customer->makeCurrent(); $default_folder = \App\Models\FileFolder::On('tenant')->Where('filefolder_id', 1)->first(); //get all the customers projects $projects = \App\Models\Project::On('tenant')->get(); foreach ($projects as $project) { //create a new default folder $folder = new \App\Models\FileFolder(); $folder->setConnection('tenant'); $folder->filefolder_name = $default_folder->filefolder_name; $folder->filefolder_creatorid = 0; $folder->filefolder_projectid = $project->project_id; $folder->filefolder_default = 'yes'; $folder->filefolder_system = 'no'; $folder->save(); //update all project files \App\Models\File::On('tenant')->where('fileresource_type', 'project') ->where('fileresource_id', $project->project_id) ->update([ 'file_folderid' => $folder->filefolder_id, ]); } } catch (Exception $e) { abort(409, $e->getMessage()); } } } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: server1.winmanyltd.com
Server IP: 203.161.60.52
PHP Version: 8.3.27
Server Software: Apache
System: Linux server1.winmanyltd.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
HDD Total: 117.98 GB
HDD Free: 59.81 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
Yes
pkexec:
Yes
git:
Yes
User Info
Username: eliosofonline
User ID (UID): 1002
Group ID (GID): 1003
Script Owner UID: 1002
Current Dir Owner: 1002