Member Since 1 Year Ago
3,540 experience to go until the next level!
In case you were wondering, you earn Laracasts experience when you:
Earned once you have completed your first Laracasts lesson.
Earned once you have earned your first 1000 experience points.
Earned when you have been with Laracasts for 1 year.
Earned when you have been with Laracasts for 2 years.
Earned when you have been with Laracasts for 3 years.
Earned when you have been with Laracasts for 4 years.
Earned when you have been with Laracasts for 5 years.
Earned when at least one Laracasts series has been fully completed.
Earned after your first post on the Laracasts forum.
Earned once 100 Laracasts lessons have been completed.
Earned once you receive your first "Best Reply" award on the Laracasts forum.
Earned if you are a paying Laracasts subscriber.
Earned if you have a lifetime subscription to Laracasts.
Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.
Earned once you have achieved 500 forum replies.
Earned once your experience points passes 100,000.
Earned once your experience points hits 10,000.
Earned once 1000 Laracasts lessons have been completed.
Earned once your "Best Reply" award count is 100 or more.
Earned once your experience points passes 1 million.
Earned once your experience points ranks in the top 50 of all Laracasts users.
Earned once your experience points ranks in the top 10 of all Laracasts users.
Started a new Conversation Array_keys() Expects Parameter 1 To Be Array, Null Given
Im getting this error when changing stripe subscription, and cashier is being used here. Now I guess this error is not with cashier or strip but here is the line with error.(within StripeObject.php)
$removed = new Util\Set(\array_diff(\array_keys($this->_values), \array_keys($values)));
although i tested this with dd() and it displays data fine. so i have no idea why it would throw an error outside dd(). if composer.json file helps ?
{
"require": {
"php": "^7.2",
"barryvdh/laravel-debugbar": "*",
"barryvdh/laravel-dompdf": "*",
"binarytorch/larecipe": "^2.2",
"brotzka/laravel-dotenv-editor": "^2.1",
"consoletvs/charts": "6.*",
"cviebrock/eloquent-sluggable": "*",
"fideloper/proxy": "^4.0",
"guzzlehttp/guzzle": "*",
"kalnoy/nestedset": "5.0",
"kingflamez/laravelrave": "^2.0",
"kris/laravel-form-builder": "1.*",
"laravel/cashier": "^9.0",
"laravel/framework": "^6.0",
"laravel/passport": "^7.0",
"laravel/telescope": "^2.0",
"laravel/tinker": "^1.0",
"laravelcollective/html": "^6.1",
"maatwebsite/excel": "^3.1.19",
"paypal/rest-api-sdk-php": "^1.14",
"pragmarx/countries": "*",
"sarfraznawaz2005/visitlog": "^1.2",
"unicodeveloper/laravel-paystack": "^1.0",
"unisharp/laravel-filemanager": "^1.8"
},
"require-dev": {
"facade/ignition": "^1.4",
"fzaninotto/faker": "~1.4",
"mockery/mockery": "~1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^8.0"
},
PS: what r these "" for in \array_keys($values) ?
Started a new Conversation Cashier/stripe Subscription Not Adding Complete Data In DB
I'm trying to create a subscription with cashier. it was working fine yesterday but now there's a problem and i don't know what changed. the problem is subscription is being created on stripe and correct data is returned but not all data is added in subscriptions table. The problem is in this function.
// dd($this->name,$subscription->id,$this->plan,$this->quantity,$trialEndsAt);
dd('builder',$this->owner->subscriptions()->create([
'name' => $this->name,
'stripe_id' => $subscription->id,
'stripe_plan' => $this->plan,
'quantity' => $this->quantity,
'trial_ends_at' => $trialEndsAt,
'ends_at' => null,
]));
you see the above commented DD() shows all data but after create(); it only shows
#attributes: array:4 [▼
"user_id" => 18
"updated_at" => "2020-12-19 12:24:04"
"created_at" => "2020-12-19 12:24:04"
"id" => 46
]
these 4 columns. now what other thing changed was this was also happening in users table when registering a new user and i solved that with
public function __construct(array $attributes = [])
{
parent::__construct($attributes);
}
i think it stoped working after this. i tried removing it , also adding it to subscriptions model but nothing works. HEELLLPPPP... EDIT: I noticed that this create function is working but just not adding my given values.I did include fillable array and as I said it was working before.
Replied to $fillable And Create() Not Working
this worked for me but what it means ? never had to do this before
Replied to Slow Website Only On Route Middleware
then why it works fine when middleware is in controller constructor ? ram is not used then ? BTW i have 16gb with 40% in use.
Started a new Conversation Stripe Customer->sources->create Error
I have stripe integrated in a project. when i try to pay it just gives me an error "Call to a member function create() on null" on line 414 and this is the line "$card = $customer->sources->create(['source' => $token]);" now i saw the code and on searching it turns out stripe does not return sources with customer after latest update. they say you have to put "expand" when sending a request, now i dont know how it works in vendor files and dont wanna mess with anything. so if someone could provide a proper fix ? laravel => 6.0 cashier =>9.0
Started a new Conversation Slow Website Only On Route Middleware
I just noticed if I put this middleware on route group, the website loads fine but after loading it gets stuck for a few seconds like nothing is clickable or scrolling then works after a while but on every menu/sidebar/navbar button click or new page, it gets stuck again its weird. But whats more weird is that if i put same middleware on controller constructors it works perfectly and dont get stuck. Now i saw the loading time it was around 700ms booting and 500ms - 600ms application on debugbar. Any solutions for this? dont know whats happening in the background making the client side stuck. also if its some java script problem then it shouldn't have any effect by middleware placement .
Awarded Best Reply on Implementing Flutter API
alright i got it working only change form_params to json and no public_key required only tx_ref , amount and redirect_url.
Replied to Implementing Flutter API
alright i got it working only change form_params to json and no public_key required only tx_ref , amount and redirect_url.
Started a new Conversation Implementing Flutter API
Hi, I'm trying to implement this "https://api.flutterwave.com/v3/payments/" api in laravel. what i want is to send some data to this api and get a url in response so I can send that url back to the ajax request on client side. client side opens that url in a new tab and pays whatever amount was set in controller now how can i implement that. This is my code so far.
$amount = some amount;
$referenceno = some ref number;
$currency = "NGN";
$redirect_url = some url;
$authorization = 'Bearer'." ".$this->fsk;
$data = [
'amount' => $amount,
'email' => email,
'metadata' => json_encode($array = [
'contest_id'=>contest_id ,
'contestent_id'=>contestant_id,
'no_of_votes'=>no_of_votes
]),
'reference' => $referenceno,
];
$client = new \GuzzleHttp\Client();
$url = "https://api.flutterwave.com/v3/payments/";
$request = $client->post($url, [
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => $authorization,
],
'form_params' => [
'public_key'=>$this->fpk,
"tx_ref"=>$referenceno,
"amount"=>$amount,
"currency"=>$currency,
"redirect_url"=>$redirect_url,
'customer'=>[
'email' => email,
'phone_number'=>some number,
'name'=>'voter',
],
"meta"=>$data,
'customizations' =>[
'title' => title,
'description' => 'Pay to vote',
]
]
]);
$response = $request->send();
dd($response);
this returns me the error
Server error: `POST https://api.flutterwave.com/v3/payments/` resulted in a `500 Internal Server Error` response:↵{"error_id":"ERRNO738287451T1607106126413","message":"Application error. Please contact support","code":"app_error"}↵"
which is not very helpful so if someone can guide me. also i dont want to send payment method so customer can just chose one from payment page.
Replied to File Not Uploading
ok turned out error:6
+files: Symfony\Component\HttpFoundation\FileBag {#48 ▼
#parameters: array:1 [▼
"file_name" => Symfony\Component\HttpFoundation\File\UploadedFile {#33 ▼
-test: false
-originalName: "testing document (10).docx"
-mimeType: "application/octet-stream"
-error: 6
path: ""
filename: ""
basename: ""
pathname: ""
extension: ""
realPath: "/home/uaarclassuaaredu/public_html/public"
aTime: 1970-01-01 05:00:00
mTime: 1970-01-01 05:00:00
cTime: 1970-01-01 05:00:00
inode: false
size: false
perms: 00
owner: false
group: false
type: false
writable: false
readable: false
executable: false
file: false
dir: false
link: false
}
]
}
which on google search turned out to be "UPLOAD_ERR_NO_TMP_DIR"
Awarded Best Reply on Laravel MS Office Files Upload Validation
OK Problem solved with interesting findings.
Removing Spaces between commas. was not always an issue , in some files it helps but in others it dosn't .... so in general no spaces is a good idea.
Empty files are not validated dont know if it was an obvious thing but ,, first time for me lol ,, . ONLY empty PDF works.
Replied to File Not Uploading
oh sorry I failed to mention size is 12 kb . rights are ok . As I said it's working fine mostly . just for few files this happens sometimes so i need better understanding of raw exceptions.
Started a new Conversation File Not Uploading
im trying to upload word, pdf, excel files. project is working fine for 1 year now with almost all files with few exceptions. sometimes some files simply refuse to upload. giving me only message from request validation ... " The file failed to upload. " Now how can I find the reason for this. A direct answer will help too but if somebody can just tell me how can i see raw exceptions on request validation instead of fancy error messages.
Replied to Customer Payment Verification And Client Side Change
okey this looks something close and im thinking of the modifications it needs to be implemented then ill reply.
Started a new Conversation Customer Payment Verification And Client Side Change
here's the scenario..
public function waitForPayment()
{
$count = 0;
$status = "not-paid";
while (true){
if(Session::get('paystackpaid') || $count>30){
$status = "paid";
break;
}else{
sleep(2);
$count++;
}
}
Session::forget('paystackpaid');
return $status;
}
when payment starts, a session paystackpaid is set to false. and on callback its set to true.
Replied to The GET Method Is Not Supported For This Route. Supported Methods: HEAD.
Replied to The GET Method Is Not Supported For This Route. Supported Methods: HEAD.
yes its like laravelproject/public , but ive always done that to make it quick , i know php artisan serve and making virtual host . but this is quick and it always worked before @sinnbeck
Started a new Conversation The GET Method Is Not Supported For This Route. Supported Methods: HEAD.
Ive been experiencing this for some time now in different projects. but mostly without even changing anything. just on the first route '/', and recently created a new laravel 8 project with jetstream and facing same issue. i fixed it once before i guess with php artisan route:cache but not working anymore. other things i tried are. php artisan optimize composer dump-autoload closing everything and opening project again. cant think of anything else. As I said its a fresh project nothing changed yet . just default route. pls help
Replied to Copying Laravel Project From One Server To Another (shared Hosting)
alright got it working . just need to delete the files in "bootstrap/config/"..... thanks everyone :)
Started a new Conversation Copying Laravel Project From One Server To Another (shared Hosting)
hi i have this laravel project perfectly working at one hosting and i need to copy it to another. i already copied full project which is not that big BUT its not working. i have done this before but i dont remember what stuff to change to make it work . now the problem is this
UnexpectedValueException
There is no existing directory at "/home/uaarclassuaaredu/public_html/storage/logs" and its not buildable: Permission denied
notice the directory "uaarclassuaaredu" this is the one from previous project . so it should not be showing on this new domain.
im using shared hosting (cpanel). no composer no ssh. need a solution ASAP . THANKS
PS: i didnt copied the storage folder cause theres alot of data in it so on this new domain i just created this folder
Started a new Conversation Ebay Getinventoryitem Not Returning Any Item
Hi im working with ebay API's and i see some problems in returning data,
"{"total":0,"size":0}"
while getinventoryitem BY SKU works fine i get all items that i search for. and the same goes for bulkgetinventoryitems all SKU's are returned fine.
Started a new Conversation Using OAuth With Laravel- Best Practices
I want to integrate ebay APIs with my inventory system. but this is a general question. What is the best practice to get access token by oAuth every time before using APIs.
1.) I was thinking of making a helper function to get (access token and and refresh token) and save with user credentials. so on a next api call i will just get the token from user table before its expiry.
2.) If access token is expired then I will use refresh token.
or use step 1 again if refresh token is also expired.
DONT WANNA USE ANY OTHER PACKAGE . KEEPING IT SIMPLE AND EASY