#### 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 ..

I can serve html files and folders within the public folder in Laravel. but I want to serve them as view & render them as view, so I can use The Authentication & Authorization middlewares on them. either if they were a lot of files, I don’t want to write a lot of routes for ..

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 ..

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 ..

I have add new column "r_cr_customer" in users table. The field is displayed as checkbox in user create VUE. I can store checkbox value in the field "r_cr_customer" of users tables but the problem is field is not checked when i show field value in the VUE. field is marked as checked when i hard ..

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 ..

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){ ..

I have a laravel project on my localhost which uses laravel ui auth for authentication in it. it used to work fine but recently I can not go to page: http://127.0.0.1:8000/login. my browser gives me the following error (I tested Chrome, Mozilla and Edge all the same result): 127.0.0.1 redirected you too many times. Try ..

I have a page with multiple posts, each post has a location and department & title. I implemented the search function for "word search" and it works fine, but in addition to this I have two Dropdown menus for location & department, they get their content from two different databases. I am kind of stuck ..

I am working on modal submit form , the problem that when I click on submit in the modal, the whole page is reloaded and all the other data is cleared. I have tried a lot of solutions but none has worked. For example adding return false This is the blade file edit.blade.php <div class="box-footer"> ..

Users can re-submit results for the competition and it updates the results on the scoreboard, however, it also creates a save of the result for the "Way back when" feature of being able to view results previously to see improvements of scores. The issue I have is that duplicate entries exist for certain months, the ..

I want to display all job posts that user have applied Here is my Tables .. applies -> | users_id | posts_id | posts -> | id | (other posts cols … ) user_info -> | id | (name col etc…) Ive tried belongsToMany() but gives error Array to string conversion Post model Relation public ..

I will explain as much as possible // route category/{id} // ->name(‘category.action’) //form <form action="route(‘category.action’)"> <!– some input’s –!> </form> I have some buttons have a function and I have one form if a specific button is pressed the button id will be switched to route by javascript Is there a way to make the ..

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 ..

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 How can i show the gold prices city wise of India and US because each state has different gold prices because of taxes so how can i show the prices for each city ? Sourc.. Read more I have 2 Laravel APIs. One API requesting a file from the second with a curl. I want to get the file as an UploadedFile without calling to new UploadedFile(). Or as alternative I want to create UploadedFile with the response contant without saving it as a temp file (and then calling new UploadedFile() with .. 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 have changed a bit of setup in my PHP application, and suddenly image uploading does no longer work. I have en endpoint expecting an image file. Whenever I pass a POST request to this endpoint WITH an image, the request body is empty. Both when I try from my frontend application and from Postman. .. Read more I’m developing a website using laravel 8 and in the home page I’m using Filterizr for the image gallery and I’ve already tried with isotope and desandro’s masonry but with the three plugins I faced the same error, when I navigate into other sections and go back to home opening a new tab the gallery .. 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’ ..

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 ..
I have two table (users and messages) .. I wrote a query to get all messages that users sent to me or I sent, using JOIN .. to get all the users I have contacted or they did. as in the code below: $users = Message::join(‘users’, function ($join) { \$join->on(‘messages.sender_id’, ‘=’, ‘users.id’) ->orOn(‘messages.receiver_id’, ‘=’, ‘users.id’); ..