Category : laravel-8

Images +++++++ I saw solutions but it doesn’t work. +++++++ <?php /** * MAKE AVATAR FUNCTION */ if(!function_exists(‘makeAvatar’)){ function makeAvatar($fontPath, $dest, $char){ $path = $dest; $image = imagecreate(200,200); $red = rand(0,255); $green = rand(0,255); $blue = rand(0,255); imagecolorallocate($image,$red,$green,$blue); $textcolor = imagecolorallocate($image,255,255,255); // imagettftext($image,100,0,50,150, $textcolor,$fontPath,$char); imagettftext($image,100,0,50,150, $textcolor,$fontPath,$char); imagepng($image,$path); imagedestroy($image); return $path; } } ?> +++++++ Php.ini ..

Read more

enter image description here Here is the error with the helpers code ++++++++++++++++++ Controller Code .. $path = ‘user/avatars/’; $fontPath = public_path(‘user/fonts/Oliciy.ttf’); $char = strtoupper($request->name[0]); $newAvatarName = rand(12,34353).time().’_avatar.png’; $dest = $path.$newAvatarName; $createAvatar = makeAvatar($fontPath,$dest,$char); $picture = $createAvatar == true ? $newAvatarName : ”; +++++++ thanks to help me Sourc..

Read more

I’m trying to update non-encrypted data in a table with: $results = app(User::class)->all(); $results->each(function(User $item) use($cols) { $updates = []; foreach($cols as $col) { $updates[$col] = encrypt($item->getRawOriginal($col)); } $item->update($updates); }); But it throws error: The payload is invalid. Looking at the trace it’s trying to decrypt an empty string. Is there a way to disable ..

Read more

I have a Laravel application for which I am trying to create a virtual host. Here is the .conf file: <VirtualHost *:80> ServerAdmin [email protected] ServerName todo-app.test ServerAlias www.todo-app.test DocumentRoot /var/www/html/vuejs/todo-laravel/public <Directory "/var/www/html/vuejs/todo-laravel"> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all Require all granted RewriteEngine On </Directory> LogLevel debug ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log ..

Read more

So I was fetching data from my database to print in a table however, it says that Class "AppHttpControllersUser" not found. Here is the controller and here is how I will print the data public function directory() { $dashboardTitle = "Directory"; $isCurrent = "Directory"; $users = User::all(); return view(‘dashboard.directory’, [ ‘dashboardTitle’ => $dashboardTitle, ‘isCurrent’ => ..

Read more

While trying to create show my students on Laravel 8, I met with some errors, first it wasn’t creating the students, then I get errors on /students/ page Attempt to read property "country_name" on null index.blade.php <tbody id="allocate-table-body"> @foreach($students as $student) <tr class="id-card"> <td><a target="_blank" href=""> {{$student->id}}</a></td> <td> {{$student->name}}</td> <td>{{$student->countries->country_name}}</td> <td>{{$student->phone}}</td> <td>{{$student->work}}</td> <td>{{$student->group}}</td> <td>{{$student->email}}</td> <td><a ..

Read more