Category : symfony

I want to use a python script but appears the following error: python is not recognized as an internal or external command operable program or batch file $process = new Process([‘python’, ‘C:Test.py’]); $process->run(); // executes after the command finishes if (!$process->isSuccessful()) { echo $process->getErrorOutput(); } when i run the same command on cmd it works ..

Read more

Since my project has deployed multiple domain names, the API interface that needs to be tested is using the api.example.test domain name as the entrance. Using $this->get(‘/v1/ping’) in Feature Test will request to www.example.test, I hope to set up $this->withHeader(‘Host’, config(‘domain.api_domain’)) uniformly in setUp in ApiFeatureBaseTestCase to automatically request API related tests to api.example.test Go ..

Read more

Now i’m doing some project use laravel framework. do i able to run Symfony Process function inside a queue jobs? use SymfonyComponentProcessProcess; use SymfonyComponentProcessExceptionProcessFailedException; right now i want to run some commend using Symfony Process function for this process = new Process("facebook-scraper –filename public/data/nintendo.csv –pages 5 nintendo"); if outside the queue. this code can run ..

Read more

I installed Laravel. Now I want to install the following package and I receive this error during installation. How can I fix the problem? package: https://github.com/codeagent/treemap error: Problem 1 Installation request for codeagent/treemap ^1.0 -> satisfiable by codeagent/treemap[v1.0.0]. Conclusion: remove symfony/console v5.1.8 Conclusion: don’t install symfony/console v5.1.8 codeagent/treemap v1.0.0 requires symfony/console ^3.1 -> satisfiable by ..

Read more

I am using Laravel 8 and validate my requests with the form request validation. However, I have a strange problem. Before I am going to describe my problem I will paste my routes and my validation class here: routes: Route::post(‘users’, [‘as’ => ‘user.search’, ‘uses’ => ‘[email protected]’]); Route::post(‘user/name’, [‘as’ => ‘user.name.exists’, ‘uses’ => ‘[email protected]’]); Route::post(‘user/email’, [‘as’ ..

Read more

I was trying to git pull by calling a spesific route. I’m using symfony/process inside my controller like so: public function pull() { $process = new Process(["git","pull"]); $process->setWorkingDirectory(base_path()); $process->run(function ($type, $buffer) { if (Process::ERR === $type) { echo ‘ERR > ‘.$buffer; } else { echo ‘OUT > ‘.$buffer; } }); } when I hit the ..

Read more

I’m writing this post because I have a problem with my relationships on Laravel. Here is the structure I currently have: 1st table: – id – name – … 2nd table : – parent_id – child_id knowing that parent_id and child_id correspond to the same table. Here is the function that links them public function ..

Read more

I’m having issues getting composer to install and run laravel. Currently on Windows, installed php(binary file or xampp) and composer(win installer or CLI). But facing the same issues when i try to do a composer install. From https://laravel.com/docs/8.x/installation: Via Laravel Installer First, download the Laravel installer using Composer: composer global require laravel/installer When running this ..

Read more

I’m having issues getting composer to install and run laravel. Currently on Windows, installed php(binary file or xampp) and composer(win installer or CLI). But facing the same issues when i try to do a composer install. From https://laravel.com/docs/8.x/installation: Via Laravel Installer First, download the Laravel installer using Composer: composer global require laravel/installer When running this ..

Read more

I’m trying to hide all the class variable from Symfony’s dumper dd, AppNamespaceClass1 {#NNN ▼ -requestCollection: [] -requestDumpOptions: [] -responseCacheTime: -1 -responseCode: -1 -responseData: "" -responseRawData: "" } I was tried to use class magic method __debugInfo but it append the dump object instead of replacing it Code : … public function __debugInfo() { return ..

Read more

While this appears to be a simple task, I’m stuck. Trying to construct a route for the path /admin that routes everything from /admin to any combination of path after /admin. This route works if the path is anything like /admin/login or /admin/error but does not catch just /admin. Route::domain(env(‘APP_URL’, ‘app.firstaccessdata.com’))->get(‘/admin/{any}’, function() { return view(‘admin’); ..

Read more

I’m trying to upgrade Laravel from 6.x to 7.x. However, I’m receiving this error and I don’t really know what’s going on here.. On my composer.json { "name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": ["framework", "laravel"], "license": "MIT", "type": "project", "require": { "php": "^7.1.3", "barryvdh/laravel-dompdf": "^0.8.4", "dpodsiadlo/svg-charts": "^1.0", "fideloper/proxy": "^4.0", "guzzlehttp/guzzle": "^7.0", "laravel/framework": "^7.0", "laravel/tinker": ..

Read more

I am building a Laravel application. I want to run a python script within my PHP script. $process = new Process([ ‘C:/Users/kaneo/AppData/Local/Programs/Python/Python38/python’, ‘test.py’, ]); $process->run(); if(!$process->isSuccessful()) { throw new ProcessFailedException($process); } $output = $process->getOutput(); //$output = json_decode($process->getOuput()); dd($output); I am able to execute commands such as ‘python –version’, and it works, but as soon as ..

Read more

I am building a Laravel application. I want to run a python script within my PHP script. $process = new Process([ ‘C:/Users/kaneo/AppData/Local/Programs/Python/Python38/python’, ‘test.py’, ]); $process->run(); if(!$process->isSuccessful()) { throw new ProcessFailedException($process); } $output = $process->getOutput(); //$output = json_decode($process->getOuput()); dd($output); I am able to execute commands such as ‘python –version’, and it works, but as soon as ..

Read more

I am trying to run a python script within my laravel project using Symfony’s process component: https://symfony.com/doc/current/components/process.html My code is within a controller and looks like this: $process = new Process([ ‘python’, ‘–version’ ]); $process->run(); if(!$process->isSuccessful()) { throw new ProcessFailedException($process); } dd($process->getOutput()); The error I get is the following: The command "python –version" failed. Exit ..

Read more

I am trying to run a python script using Symfony Process, but somehow it isn’t working. What could be the problem? Below is the code i am using to run the python script. $process = new Process([‘python’, ‘/d/Programs/Programming/XAMPP/htdocs/Musify/public/python/script.py’]); $process->run(); if (!$process->isSuccessful()) { throw new ProcessFailedException($process); } $data = $process->getOutput(); dd($data); Sourc..

Read more

trying to upgrade a Laravel project(was 5.4, i am upgrading it to 7), i have run into a brick wall with this. when i run PHP artisan optimize, it gives me this error. [2020-09-16 05:35:06] production.ERROR: Argument 1 passed to SymfonyComponentHttpFoundationRequest::create() must be of the type string, null given, called in {my_project_path}/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/SetRequestForConsole.php on line 32 ..

Read more