laravel

How do I capture originalName in laravel 7 using NowUI dashboard?

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-08 10:40:31
问题 I am trying to upload an image using Laravel 7. I have displayed the form input using dd() and am getting the bellow output for profile image. How doi I capture the originalName and save to the database? "profile_image" => Illuminate\Http\UploadedFile {#1251 ▼ -test: false -originalName: "dvdvdvd.png" -mimeType: "image/png" -error: 0 #hashName: null path: "/tmp" filename: "phpMTKWo0" basename: "phpMTKWo0" pathname: "/tmp/phpMTKWo0" extension: "" realPath: "/tmp/phpMTKWo0" aTime: 2020-09-28 09

Laravel 5.5 Error 405 (Method Not Allowed) XHR PUT METHOD now working on Azure Server

拈花ヽ惹草 提交于 2021-02-08 10:28:26
问题 I have installed Laravel 5.5 on Azure Web Server with PHP 7 installed. Other request methods working well except the XHR PUT METHOD. It returns an error message on the console: 405 (Method Not Allowed) and XHR network preview: The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used. I already allowed the PUT method on web.config files <?xml version="1.0" encoding="utf-8"?> <configuration> <system.webServer> <urlCompression doDynamicCompression=

foreach Laravel-5 <option select

孤人 提交于 2021-02-08 10:28:18
问题 I have tried a lot of variants of code and tried to find similar problem in other topics. So, i have table users where each user is having one city(stored as a number), and of course table city with id and name of city (40 cities is there). When real user open his profile settings page I want his city to be selected and and displayed in form. In this example in user table "Alex" is having city"2". In table city: id "2" and name_ru "cityB". If i try this: @foreach(App\City::get() as $city)

Laravel 5.5 Error 405 (Method Not Allowed) XHR PUT METHOD now working on Azure Server

大兔子大兔子 提交于 2021-02-08 10:26:25
问题 I have installed Laravel 5.5 on Azure Web Server with PHP 7 installed. Other request methods working well except the XHR PUT METHOD. It returns an error message on the console: 405 (Method Not Allowed) and XHR network preview: The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used. I already allowed the PUT method on web.config files <?xml version="1.0" encoding="utf-8"?> <configuration> <system.webServer> <urlCompression doDynamicCompression=

Laravel - How to run a function/controller every minute ? (Task Scheduling)

早过忘川 提交于 2021-02-08 10:20:12
问题 https://laravel.com/docs/5.4/scheduling Hey Guys , I have a controller method that i want to run every minute . I read the documentation for Task Scheduling but it seems to document Commands only. Is there any way that i can use it to call a route/controller method/script every minute ? <?php namespace App\Http\Controllers; use App\Http\Controllers\Controller; use DateTime; use Illuminate\Support\Facades\DB; use App\Acc; class ScriptController extends Controller { public function UpdateAcc()

Pass variables to multiple view in laravel

落花浮王杯 提交于 2021-02-08 10:13:00
问题 I want to pass a variable to multiple view bu when i use share method in View. Its says the share method isn't find on View. How you say i use it and i try the composer either but no matter how i try it can't work could you give me simple example of this action My controller categorycontroller.php public function site(){ $data = array(); $data['subcategories'] = SubCategory::all(); $data['categories'] = Category::all(); return view('template.sitemap',compact("data")); } My route web.php Route

Flutter file upload with Dio empty in Laravel

 ̄綄美尐妖づ 提交于 2021-02-08 10:12:36
问题 I'm unable to upload files using the Dio plugin and I can not figure out where's the problem. In Laravel the request is always empty. What have I done so far: Double check if the file path really exists using existsSync() function Changed the Content-Type to application/x-www-form-urlencoded Validated if the file is actually being uploaded - seems yes (?) This is my flutter code: File myFile = new File('/storage/emulated/0/Download/demo.docx'); FormData form = new FormData.from({ 'title':

Laravel update/edit using foreach loop

妖精的绣舞 提交于 2021-02-08 10:01:48
问题 I was trying to update my table but I couldn't make it work.. I always end up with the error: Invalid argument supplied for foreach() Here is my Controller: public function show_score($id) { $scores = Score::with(['lead','subject'])->where(['subject_id'=>$id])->get(); return view('markbook.show_score',compact('scores')); } public function update_score(Request $request) { $id = $request->input('id'); $scores = Score::find($id); foreach ($scores as $datas) { $datas->jan_ap=$request->input('jan

Ajax, the old value appears first and then the new one

痴心易碎 提交于 2021-02-08 09:15:26
问题 I have Session::flash notifications(bootstrap toasts), which is used to notify about adding a product to the cart: @if(Session::has('add-product')) <div aria-live="polite" aria-atomic="true" class="d-flex justify-content-center align-items-center"> <div class="toast fixed-top" role="alert" aria-live="assertive" aria-atomic="true" data-delay="3000"> <div class="toast-header bg-success"> <span class="mr-auto notif_text"></span> <button type="button" class="ml-2 mb-1 close" data-dismiss="toast"

How to get the average time in Laravel

落花浮王杯 提交于 2021-02-08 08:55:27
问题 I want get the the average time between start-time and end-time and Where CUR-Time GroupBY user-name i written the sql in laravel it's showing some error i can't find what's that because i'm new to that laravel please help to fix this sql error i submit the my sql and the error message. $avagTime = DB::table( 'active_user' ) ->select(DB::raw('AVG(TIME_TO_SEC(acu_et) - TIME_TO_SEC(acu_at))')) ->where (DATE('acu_at') == ('CURDATE()')) ->get();[![enter image description here][1]][1] 回答1: Try