#### Category : php-7

I’m making a website which allows users to post videos. Since HTML5 doesn’t take mov file, is there a way to convert files using Laravel? Sourc..

I working on the few of the small decimals like 0.0000687, 0.0000063241, 0.0000454. I used BCMath as to get the most precise result because it involved with money calculation, so far BCMath it is very helpfull to me in fixing my previous bug that I faced. But I found that BCMath cannot work well if ..

I might not have titled this correctly but heres the question: How can I add to a static array within a class? class Check extends Model { public static $toSend = []; public static$total = 0; public function test() { $this->total = 20; echo$this->total; $this->toSend[0] = [‘size’=>1,’num’=>1]; echo$this->toSend; die(); } } In ..

I have flexible columns in my project so I keep this data in the form of metadata. In order to update a row in my data table, I bring input as many as the number of columns available and I want to print the data in my rows into these inputs, but when I do ..

I wrote the function at controller ,but it does not function. Please how to solute.enter image description here Sourc..

I want to get a list of all timezones. When I use DateTimeZone::listIdentifiers() I get a list, And when I use DateTimeZone::listAbbreviations() I get a list with different entries. Each list has values that are not in the second list. How to get a complete list? Why is there a difference between the two functions? ..

I have a function that I’d like to only like to accept an eloquent collection. This is okay but really I’d like to specify that it can only accept collections from a certain model. Is it possible to specify that we only want a collection of a certain type to function arguments? This is what ..

I am using Jquery Query Builder in an PHP application. https://querybuilder.js.org/ How can i prefix sql result with alias like this alias.column=value AND alias.column2=value2 AND alias.column3=value3 OR alias.column4=value4 my code is var sql = resH = ”; var result_json = builder.queryBuilder(‘getRules’); if(result_json) { var res = builder.queryBuilder(‘getSQL’); var resH = builder.queryBuilder(‘getHumanCond’); if(typeof res.sql != ‘undefined’) ..

I downloaded an open-source web application from GitHub called Electronic Document Management System (EDMS) from this link: https://github.com/hpbyte/edms I also tried following the step-by-step procedure on how to setup and install downloaded Laravel Web Applications from GitHub. I successfully logged in into the Web Application, and was able to land the dashboard: https://i.imgur.com/fa58Sij.png The problem ..

I am working on my local server right now and trying to get rid of ‘/public/index.php’ from http://localhost/example/public/index.php/ in the url. I have followed content from the site: https://www.tutsmake.com/how-to-remove-public-from-url-in-laravel/ and added the config file laravelex.conf with the following content: <VirtualHost *:80> ServerName localhost ServerAdmin [email protected] DocumentRoot /var/www/example/public <Directory /var/www/example> Options Indexes FollowSymLinks MultiViews AllowOverride All ..

I am trying to install pcntl extension for php7.4. I check install status, it seems like installed successful $php -m | grep pcntl pcntl # php -i | grep pcntl pcntl pcntl support => enabled But when I dump phpinfo() from laravel code, there are no pcntl info. Where did my config go wrong? .. Read more I’m setting up a tidal observations endpoint using Fisheries and Oceans Canada SOAP web service (https://tides.gc.ca/eng/info/WebServicesWLD and https://ws-shc.qc.dfo-mpo.gc.ca/predictions?wsdl). It involves looking at an old application that’s in vanilla PHP, and porting it into Laravel. Both the vanilla and Laravel versions work, but for some reason in Laravel I can’t set the max size of the .. Read more can explain to me, anyone, to differences between php5 and php7. is there only a difference in function or else another difference? and how to change the PHP version from php7 to php5 Sourc.. Read more I wanted to use beyondcode/laravel-er-diagram-generator to generate diagram of my Lumen app. Installation went smoothly with no issues. When I run php aritsan generate:erd I get:$ php artisan generate:erd In Php7.php line 1170: A trailing comma is not allowed here on line 71 I started investigation and I’ve found that this links to one ..

The code below works fine: $data = Structures::select("id", "parent_id", "category", "type", "subType", "variant", "description") ->orderBy(‘category’) ->orderBy(‘type’) ->orderBy(‘subType’) ->orderBy(‘variant’) ->get() ; return$this->fillCategories($data) ; The fillCategories() function fills a JSON tree with parent child relationships. However, the code below, doesn’t work.$data = DB::table("categories AS t1") ->select("t1.id", "t1.name AS category", "t2.id as typeId", "t2.name as type", ..

I’m using Laravel 8 to loop over some data. I’ve got my data out from my database, but am struggling to loop over the data in a foreach loop, it doesn’t appear to be giving me the key/value pairs, only the index/value pair? $applicationOptions = ApplicationOptions::where(‘form_type’,$form_type)->get(); foreach ($applicationOptions as$key => $value) { // .. Read more In my Laravel’s middleware I generate a custom header value.$correlationId = Uuid::uuid4()->toString(); if ($request->headers->has(‘Correlation-ID’) === false) {$request->headers->set(‘Correlation-ID’, $correlationId); } When I throw an exception I easily get it in Sentry along with my custom header. But the power of using Sentry and Correlation Id is when you tag something, each tagged value is .. Read more When the person is registered, I want a private e-mail to be sent to the name of the person, but I could not reach. my RegisterController; protected function create(array$data) { $user =User::create([ ‘name’ =>$data[‘name’], ’email’ => $data[’email’], ‘password’ => Hash::make($data[‘password’]), ]); $to_name = ‘Laravel Bootcamp’;$to_email = $data[’email’];$body = []; $mailData = .. Read more Currently building a Laravel application which allows users to generate football (soccer) tournaments – mostly for 5-7 a side. When creating a tournament, the organiser chooses whether it’s a round-robin or knockouts tournament. They also define how many pitches are available (e.g. 1, 2, 3), how long each match is in minutes and also how .. Read more I have content stored in the database like so: Using this to display code examples on the frontend. From what I understand, I’m escaping the content properly within the blade template: However, the double brackets within my code example seem to be bonking out the page when it tries to load: In order to get .. Read more I got this error message after I made Jobs to send an email "in SendEmail.php line 3" <?php ​ namespace AppJobs; use IlluminateBusQueueable; use IlluminateContractsQueueShouldQueue; use IlluminateFoundationBusDispatchable; use IlluminateQueueInteractsWithQueue; use IlluminateQueueSerializesModels; use AppMailResetPassword as Reset; use Mail; ​ class SendEmail implements ShouldQueue { use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; protected$reset; /** * Create a new ..

I ran composer require –dev "xethron/migrations-generator" on my local system which runs on php7.4 and it works well. But on running the command on my server which runs on php7.0.3, I get the error doctrine/inflector v1.3.0 requires php ^7.1 -> your PHP version (7.0.33) does not satisfy that requirement. I’m not allowed at my company ..