laravel

How to get the average time in Laravel

删除回忆录丶 提交于 2021-02-08 08:55:19
问题 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

View [welcome] not found

十年热恋 提交于 2021-02-08 08:01:08
问题 I deployed my Laravel app (with Cloud SQL integration) onto Google App Engine with the following settings. app.yaml runtime: php73 env_variables: LOG_CHANNEL: stackdriver APP_LOG: errorlog APP_KEY: [APP KEY] APP_URL: "http://example.com/" APP_STORAGE: /tmp VIEW_COMPILED_PATH: /tmp CACHE_DRIVER: database SESSION_DRIVER: database DB_DATABASE: cbt-sql DB_USERNAME: root DB_PASSWORD: [PASSWORD] DB_SOCKET: "[SOCKET DETAILS]" I ran the usual config/cache/view/route clear commands. Using gcloud beta

View [welcome] not found

会有一股神秘感。 提交于 2021-02-08 08:01:07
问题 I deployed my Laravel app (with Cloud SQL integration) onto Google App Engine with the following settings. app.yaml runtime: php73 env_variables: LOG_CHANNEL: stackdriver APP_LOG: errorlog APP_KEY: [APP KEY] APP_URL: "http://example.com/" APP_STORAGE: /tmp VIEW_COMPILED_PATH: /tmp CACHE_DRIVER: database SESSION_DRIVER: database DB_DATABASE: cbt-sql DB_USERNAME: root DB_PASSWORD: [PASSWORD] DB_SOCKET: "[SOCKET DETAILS]" I ran the usual config/cache/view/route clear commands. Using gcloud beta

PHP exception not being caught, laravel, lumen

荒凉一梦 提交于 2021-02-08 07:59:58
问题 When attempting to catch/handle an exception thrown from PDFParser, I cannot catch it. I use a simple try catch statement, outlined below. try{ $pdf = $parser->parseFile($filepath); $text = $pdf->getText(); } catch( \Exception $e){ $text = $paper->abstract; } The exception is thrown as follows. if (empty($data)) { throw new \Exception('Object list not found. Possible secured file.'); } The output is here. lumen.ERROR: Exception: Object list not found. Possible secured file. in /Users

Edit db record with modal window

。_饼干妹妹 提交于 2021-02-08 07:58:53
问题 I'm trying to edit some database record based on an ID that I'm saving into a button value. @foreach ($employment as $empl) <button data-toggle="modal" data-target="#edit-empl" href="#edit-empl" class="btn btn-default editbtn-modal" value="{{ $empl->id }}" type="button" name="editbtn">Edit</button> <h3 class="profile-subtitle">{{ $empl->company }}</h3> <p class="profile-text subtitle-desc">{{ $empl->parseDate($empl->from) }} - {{ $empl->parseDate($empl->to) }}</p> @endforeach As you can see

PHP exception not being caught, laravel, lumen

我们两清 提交于 2021-02-08 07:58:52
问题 When attempting to catch/handle an exception thrown from PDFParser, I cannot catch it. I use a simple try catch statement, outlined below. try{ $pdf = $parser->parseFile($filepath); $text = $pdf->getText(); } catch( \Exception $e){ $text = $paper->abstract; } The exception is thrown as follows. if (empty($data)) { throw new \Exception('Object list not found. Possible secured file.'); } The output is here. lumen.ERROR: Exception: Object list not found. Possible secured file. in /Users

PHP exception not being caught, laravel, lumen

限于喜欢 提交于 2021-02-08 07:58:41
问题 When attempting to catch/handle an exception thrown from PDFParser, I cannot catch it. I use a simple try catch statement, outlined below. try{ $pdf = $parser->parseFile($filepath); $text = $pdf->getText(); } catch( \Exception $e){ $text = $paper->abstract; } The exception is thrown as follows. if (empty($data)) { throw new \Exception('Object list not found. Possible secured file.'); } The output is here. lumen.ERROR: Exception: Object list not found. Possible secured file. in /Users

Laravel session data is lost after click

陌路散爱 提交于 2021-02-08 07:56:38
问题 class FileController extends Controller { public function login() { /* * TODO: Handle via CAS * Hardcoded for demo purposes */ Session::put('isLogged', true); Session::put('index', "123456"); return View::make('login'); } public function user() { if(Session::get('isLogged') == true ) return View::make('user'); } } I have the following code. There is a link on login that goes to the FileControllers@user . On the second page my session data is lost (Session::all() is empty). What could be

Laravel session data is lost after click

我与影子孤独终老i 提交于 2021-02-08 07:55:33
问题 class FileController extends Controller { public function login() { /* * TODO: Handle via CAS * Hardcoded for demo purposes */ Session::put('isLogged', true); Session::put('index', "123456"); return View::make('login'); } public function user() { if(Session::get('isLogged') == true ) return View::make('user'); } } I have the following code. There is a link on login that goes to the FileControllers@user . On the second page my session data is lost (Session::all() is empty). What could be

Add action during login process

旧街凉风 提交于 2021-02-08 07:51:49
问题 I am building a Laravel 7.x. application that will combine both standard authentication (user logs on via form) and API authentication through Sanctum (token based). I want to generate a sanctum API token during successful user authentication. To do that, I need to hook into the login flow. Standard authentication was scaffolded to my application by running php artisan ui vue --auth . When I inspect routes/web.php , I can see only Auth::routes(); which under the hood allegedly generates the