Category : php

I am trying to use Laravel for the first time. I am trying to install it precisely as the guide says with composer but when I create a new project I get the following error: Problem 1 – laravel/framework[v8.65.0, …, 8.x-dev] require league/flysystem ^1.1 -> satisfiable by league/flysystem[1.1.0, …, 1.x-dev]. – league/flysystem[1.1.0, …, 1.x-dev] require ..

Read more

I want make axios return a response of just logged in user’s id. When I was using Laravel Fortify with blade.php files, everything was too simple. Fortify was doing redirect to home page automatically after the successful login. But when I started to use Laravel with vue js and vuex, I faced a problem. When ..

Read more

Below code is my document and notes controller show function but it working perfectly on my laravel 5 project recently I’ve updated my project in to laravel 8 now it’s showing a error like this please help me out for this guys public function show($id) { //model id like project_id, user_id $notable_id = request()->get(‘notable_id’); //model ..

Read more

So I am trying to use a laravel project that I already used before, these errors shows whenever I use any php artisan command: php artisan migrate PHP Warning: require(/var/www/html/orange/php/application/vendor/guzzlehttp/psr7/src/functions_include.php): failed to open stream: No such file or directory in /var/www/html/orange/php/application/vendor/composer/autoload_real.php on line 54 PHP Fatal error: require(): Failed opening required ‘/var/www/html/orange/php/application/vendor/guzzlehttp/psr7/src/functions_include.php’ (include_path=’.:/usr/share/pear:/usr/share/php’) in /var/www/html/orange/php/application/vendor/composer/autoload_real.php ..

Read more

I have routing problem, that I can’t seem to fix. So first: Here is a dynamicly created buttons in my "languages.blade.php" <a href="edit-keywords/{{ $language->language_code }}" class="btn btn-success btn-sm"><i class="fa fa-language"></i>&nbsp; Edit Keywords</a> Here is routing lines in my "web.php" Route::get(‘/admin/edit-keywords/{code}’, [AppHttpControllersAdminLanguageController::class, ‘edit_keywords’])->name(‘admin.edit-keywords’); Route::post(‘/admin/edit-keywords’, [AppHttpControllersAdminLanguageController::class, ‘save_keywords’])->name(‘admin.save_keywords’); Here is public function in my "LanguageController.php" public function edit_keywords($code){ ..

Read more

Data is generated like so: $repResults[] = [ ‘label’ => (new CarbonCarbon($wbwResult->created_at))->isoFormat(‘DD-MM-YY’), ‘data’ => [ # datatype cast to int to prevent {!! xss !!} (int) $wbwResult->discipline_three, (int) $wbwResult->discipline_four, (int) $wbwResult->discipline_five, (int) $wbwResult->discipline_six, ] ]; I am then trying to output the data as a line chart: const ctx = document.getElementById(‘myChart’).getContext(‘2d’); const myChart = new ..

Read more

I have an overview site with a filter canton on top. The user can filer for location and department. The code of the controller looks like this: public function index(Request $request) { $posts = Post::orderBy(‘titel’) ->get(); $standorts = Standort::get(); $abteilungs = Abteilung::get(); if ($request->filled(‘s’)) { $query = strtolower($request->get(‘s’)); $posts = $posts->filter(function ($post) use ($query) { ..

Read more

I have a small slider that switches the preview image to the main image. It works fine now blade.php <div class="custom-carousel-section"> <div class="custom-container"> <div class="custom-carousel"> @if(!empty($article_block_images)) @foreach($article_block_images as $article_block_image) <div class="custom-carousel__title"> @if($loop->first) <span>{{ $article_block_image->title }}</span> @endif </div> @endforeach @endif @if(!empty($article_block_images)) @foreach($article_block_images as $article_block_image) <div class="main-image"> @if($loop->first) <img src="{{ $article_block_image->main_image }}" alt="{{ $article_block_image->image_alt }}" title="{{ $article_block_image->image_title ..

Read more

i want to resize and crop the images when they are uploaded. My script works in local but recently i deployed it in heroku and doesn’t work this is my full script public function store(Request $request) { $data = $request->validate([ ‘title’ => ‘required|min:5’, ‘category’ => ‘required’, ‘preparation’ => ‘required’, ‘ingredients’ => ‘required’, ‘img’ => ‘required|image’ ..

Read more

I’m trying to install mgp25/instagram-php packages from local repository. this packages has a own composer.json file which that have this line there "binsoul/net-mqtt-client-react": "^0.3.2", and that cause a getting this error when i’m running this command: composer install/update for 0.3.2 version of this package, i should have php ~5.6|~7.0 but in main project my php ..

Read more

This is a roles&permissions table, I can change user’s role so far, but delete user. How can I sperate change role and delete actions ? <form action="edit-role-permission/{{ $user->id }}" method="POST"> @csrf <select name="roles"> <option name ="user" value="user">User</option> <option name= "staff" value="staff">Staff</option> </select> <button type="submit">Change role</button> <button type="submit">Delete</button> </form> Route::post(‘edit-role-permission/{user}’, [AdminController::class, ‘editRolePermission’]); //class AdminController extends Controller ..

Read more

In Laravel am trying to query a database with the results of a previous query. My current code: $firstResults = Model1:all()->sortByDesc(‘id’)->take(1)->toArray(); $secondResults = Model2:all()->where(‘hash’,$firstResults["hash"])->toArray(); The first query works fine. I want to use the results of the first query to search the second table where ‘hash’ is equal to the ‘hash’ value from the results ..

Read more