About tpl files how it works - windows

I got a tpl file in website is it a bug.?
What if it shows 403 and I bypass it?
I am new to it can you elaborate it in detail what is tpl file and what is it used for and any other knowledge will be helpful.....

Related

Find exact value of VUE_APP_API_BASE_URL for laravel project

I have a laravel + Vue.js project template downloaded from Creative Tim. Its login and register is not proceeding, giving the catch error whereas in the template demo its working fine. I think so the instructions said to write the VUE_APP_API_BASE_URL in Vue .env file and I didn't wrote it correct. Can anyone pls tell me how can I locate the exact address and what syntax it would be?
Since you are using vue with laravel, you need to prefix MIX_ before the variable. Eg:
MIX_VUE_APP_API_BASE_URL=http://localhost:8000
Here is the reference: https://laravel.com/docs/8.x/mix#environment-variables

After downloading zip folder the code next to it is not working

I am working with PHP code igniter i wrote below code to download the file.
Which reads file and download it as zip. It working fine. But when i write other code below download it stop working. For example if i echo the sum two digit it wont work. Will any one guide me on this.
$this->zip->read_file($path);
$filename= "zip-name";
$done = $this->zip->download($filename);
//Below code not working
$a=10;
$b=10;
echo $a+$b;
That's intended behaviour. See the hint in Codeigniter Docs for that function:
Do not display any data in the controller in which you call this method since it sends various server headers that cause the download to happen and the file to be treated as binary.
That's why download platforms typically do a delayed, JavaScript controlled redirect ("Your Download will start shortly..")

Unexpected Behavior in Laravel 7 with Storage::put() and fopen()

I am working on a solo project where admin users will be able to manage Virtual Machines via a web application run on laravel 7. I am currently creating the creation controller which requires uploading large files (.ovas). I am trying to use streams (I think) in a store method.
Specifically, a view has a form with a standard file inclusion that sends the request to the controller. The form gets validated and then I try to move the file into storage as such:
$data = $this->validator($request);
Storage::put('files', fopen($data['file'], 'r+'));
Where $data['file'] is the uploaded file. I can see the file being uploaded locally (while monitoring hdd usage), but after it is sent, laravel returns the following error
fopen(/var/www/html/devel/ocl/storage/app/files): failed to open stream: Is a directory
The error seems pretty obvious, so I was curious and decided to return the fopen() call before storage to see if I could invoke the same error by changing the method to:
$data = $this->validator($request);
return var_dump(fopen($data['file'], 'r+'));
However, no error is invoked and I get resource(8) of type (stream) as expected (I think). The tmp resource disappears and no errors are thrown. I am a bit baffled on why this is occurring as I would assume that function call resolves before the storage. I feel like I'm missing something fundamental with PHP/laravel and cannot think of how to continue to explore the issue.
Why does the first call to fopen() seem to see $data['file'] as a path, but the second call to just fopen() work as intended? I am hoping the answer can help remedy the issue.
Thanks!

Failed to load resource when using Auth

The problem
If I use the class Auth in a route/view/controller what so ever, I get the following error in chrome/firefox etc: Failed to load resource URL_TO_CURRENT_PAGE:LAST_LINE_NUMBER
The Html is correct, if I copy the code and paste it into a .html file and open it via the webserver I get no errors.
My code
http://paste.laravel.com/zpp
is this a bug or is it my fault?
I found the problem, the problem is the library entrust. If I dont use it, everything works as intended.

PyroCMS accessing a module controller inside system routes file

I tried accessing a module controller in the $route['default_controller'] setting in routes.php but I'm getting the following error:
I have been getting this error a lot lately and don't understand entirely what exactly it means. Does anybody know what I'm doing wrong? Below is my routes statement:
$route['default_controller'] = 'contractors/routes/mainDisplay';
The error is about the language file not the routing. Apparently you have loaded a lang file in you module but pyrocms can't find the file. make sure that the language file is placed correctly and check the filename which should be contractors_lang.php.
do you have this file?
../modules/contractors/language/english/contractors_lang.php
if not, make one.

Resources