Category : syntax-error

I’ve just upgraded my (Windows 10 2004) system from PHP 7.4 to PHP 8.0.3. I did this by uninstalling then reinstalling XAMPP with the later version. I am developing a Laravel 8.0 application in VS Code v 1.55, and the application runs absolutely fine. However, every single namespace/use statement in every single .php file has ..

Read more

I don’t understand what’s wrong with the code I created public function postRegister(Request $request) { $admin = new SuperAdmin(); $admin->NIP = Input::get("NIP"); $admin->username = Input::get("username"); $admin->password = bcrypt(Input::get("password")); $admin->nama_adm = Input::get("nama_adm"); $admin->no_hp = Input::get("no_hp"); $admin->role_id = DB::table(‘roles’)->select(‘id’)->where(‘namaRole’, ‘superadmin’)->first(); $admin->save(); } when I’m using var_dump($admin); the result : object(AppSuperAdmin)#258 (27) { ["table":protected]=> string(10) "admin_role" ["fillable":protected]=> array(3) ..

Read more

I am using graphql with vuejs and laravel and it was working well on my local env but i am getting Syntax Error: Unexpected after i launched it on the live server. Does anyone facing this issue and do you know how to solve it? Thanks APP_NAME="HLH EXPRESS" APP_ENV=local APP_KEY= APP_DEBUG=true APP_URL=http://hlhexpress.xyz LOG_CHANNEL=stack DB_CONNECTION=mysql DB_HOST=localhost ..

Read more

I have simple part of code to detect type of Discount, i added another type, but how to use operator OR (||) right way in this case ? ->where(‘taken’, "N") or "R" do something. this wont work ->where(‘taken’, "N" || "R") $code = Discount::where(‘code’,$discount_code) ->where(‘expiry’,’>’,Carbon::now()->toDateString()) ->where(‘subscription’, $subscription) ->where(‘taken’, "N") ->first(); Sourc..

Read more