Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,738 members, 7,817,034 topics. Date: Saturday, 04 May 2024 at 12:05 AM

Jacob05's Posts

Nairaland Forum / Jacob05's Profile / Jacob05's Posts

(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (of 37 pages)

Programming / Re: Populating Select Menu From Model In User Registration Form In Laravel by jacob05(m): 11:19pm On Aug 29, 2015
maekhel:

How do create an api route

It's just a normal route.. But instead of returning a view you return a "TYPE"... The "TYPE" can be a string, XML, and most preferably JSON

eg
return Response::json(array('name' => 'Steve', 'state' => 'CA'));
Programming / Re: Laravel:call To Undefined Method Illuminate\database\eloquent\collection::save() by jacob05(m): 10:56pm On Aug 29, 2015



$account = Account::where('gender','=','male');

$account->name ="Ademola Plumptre";

$account->save();



In the Above, We're trying to find all Accounts in the database that has the value of 'male' as gender or that is owned by a male .... so this query is most likely to return more than one record from the database or none from the database. This would cause 'Eloquent' to return a Collection even if the number of records found is One/1.. Because the the returned value is a Collection, we would need to loop through the returned set to have access to the individual Model.

In the above, the value returned to $account is a Collection. so trying to access a property or an Eloquent method on the result would cause an error...
The above can be rewritten as



$accounts = Account::where('gender','=','male');

$accounts->each(function($account)
{
$account->name ="Ademola Plumptre";
$account->save();
});

We're now changing the name of all male account holders to "Ademola Plumptre";

If we only want to change the name of the first Account in the DB that is owned by a male then we chain our where with first method... Note ... the result of first can only be one record, so Eloquent returns an Eloquent model of the first Account which we can modify after fetched..




$account = Account::where('gender','=','male')->first();

$account->name ="Ademola Plumptre";

$account-->save();

Programming / Re: Laravel:call To Undefined Method Illuminate\database\eloquent\collection::save() by jacob05(m): 10:20pm On Aug 29, 2015


$account = Account::find(10);

$account->name ="Ademola Plumptre";

$account-->save();



In the Above, We're trying to find an Account in the database that has an id of 10 .... so this query is always going to return a single Object or none from the database. so an Eloquent Model object of Account would be returned from the database if there is an Account with an id of 10 in the database. With the returned Eloquent model, we can update the name field and call the save method directly.
Programming / Re: Populating Select Menu From Model In User Registration Form In Laravel by jacob05(m): 10:12pm On Aug 29, 2015
maekhel:

yes

use Javascript .... You'd need an API call too.. to fetch the result based on the selected select option
Programming / Re: Laravel:call To Undefined Method Illuminate\database\eloquent\collection::save() by jacob05(m): 10:09pm On Aug 29, 2015
All multi-result sets returned by Eloquent, either via the get method or a relationship, will return a collection object.

Simple put... If the result of your query is likely to return more than one value, Laravel returns a collection.

Understanding query methods that returns a Collection would save you the problem of calling an Eloquent model method on a Collection..
Programming / Re: Populating Select Menu From Model In User Registration Form In Laravel by jacob05(m): 9:41pm On Aug 29, 2015
maekhel:
How do I populate a select menu based on a previous select menu option in laravel.
One thesame page
Programming / Re: Q-basic Program To Compute Simple Interest. by jacob05(m): 8:27pm On Aug 29, 2015
Vstuffs:

Thanks a lot for the correction
You're welcome wink
Programming / Re: Q-basic Program To Compute Simple Interest. by jacob05(m): 8:11pm On Aug 29, 2015
Vstuffs:


Just a little addition

DIM P as Integer
DIM R as integer
DIM T as integer
DIM Interest as integer
CLS
PRINT " Program to Calculate Simple Interest"
PRINT
INPUT "Enter Value for Principal", P
INPUT "Enter Value for Rate", R
INPUT "Enter Value for Time', T
interest= (P*R*T)/100
print interest
End
should be DIM Interest as Double
Jobs/Vacancies / Re: Andela: IT Training And Job by jacob05(m): 3:03pm On Aug 29, 2015
tgmservice:
Is it 81k for the first three months combined

sname00:
is it 81k per month or for the three months together. plus how progressive is it? This thing is four years

Monthly
Jobs/Vacancies / Re: Andela: IT Training And Job by jacob05(m): 11:25am On Aug 29, 2015
tgmservice:
Pls what is the monthly stipend one will get during the four year program
~81k for first 3 to 5 months... then increments based on performance..
Jobs/Vacancies / Re: Andela: IT Training And Job by jacob05(m): 9:56am On Aug 29, 2015
Sadly ... I may not be around for the bootcamp... undecided .. #NYSC_wahala
Jobs/Vacancies / Re: Andela: IT Training And Job by jacob05(m): 9:44am On Aug 29, 2015
babyfina:
yipee I got an invite tu boot camp.


Got an invite Tooo... cheesy cheesy cheesy grin grin grin

1 Like

Programming / Re: President Buhari Voice Recognition Program - Contest For 50,000 Naira by jacob05(m): 7:36am On Aug 29, 2015
Akosa007:
is this contest still on, and if so i got something
It's still on.. undecided undecided
Jobs/Vacancies / Re: Andela: IT Training And Job by jacob05(m): 5:51pm On Aug 28, 2015
1Dray:


Thought interviews was supposed to end on Thursday.
Yea.. but it was extended on Google calendar
Jobs/Vacancies / Re: Andela: IT Training And Job by jacob05(m): 5:31pm On Aug 28, 2015
Ramos16:
had my interview yesterday, monday, best interview ever, they were realy great guys, i even got a git sticker *hehe* from one of the interviewers, but i get a feel they might not place me in JS class during boot camp... But i realy prefer JS

Cool dudes.. Got interviewed today too.
Programming / Re: How To Add Icon To Visual Basic 6.0 Form by jacob05(m): 5:39pm On Aug 27, 2015
MuhammaduBuhari:

Thank you very much for that question o. I am shocked to say the least!
grin grin grin
Programming / Re: Create A Nested Lists Of Categories In Laravel 5 by jacob05(m): 5:39pm On Aug 27, 2015
MuhammaduBuhari:

We need to do a census one day. I am surprised that we have so much laravel folks as well.
Yea.. Laravel Rocks !!!

1 Like

Programming / Re: How To Add Icon To Visual Basic 6.0 Form by jacob05(m): 11:19am On Aug 27, 2015
MuhammaduBuhari:

Wrong tools means you are not grounded as a programmer, means that you did not do your ground-work well. Or maybe you use a tool that is too complicated for your brain. Or that you are a learner and not a programmer.
grin grin grin grin grin
Programming / Re: How To Add Icon To Visual Basic 6.0 Form by jacob05(m): 11:15am On Aug 27, 2015
MuhammaduBuhari:

See, the only algorithm i know is this:

CLIENT CARRY PROBLEM COME -------- I SOLVE THE PROBLEM ANYHOW -------- COLLECT MONEY ------- WAKA DEY GO

--- THE END
hmmmmm... Upgrades ?? Fixes Feature requests .... #JUSTSAYiNG
Programming / Re: How To Add Icon To Visual Basic 6.0 Form by jacob05(m): 11:14am On Aug 27, 2015
#JUSTSAYING
Programming / Re: How To Add Icon To Visual Basic 6.0 Form by jacob05(m): 11:14am On Aug 27, 2015
MuhammaduBuhari:

See, every programmer with their own techniques. When i get a job to do, I come up with the algorithm, and out of my own limited experience, i select the fastest way out and solve the problem.
One of the recent apps i deployed make use of the following technologies:
- VB.NET
- PHP for windows (because i needed to make use of some PHP libraries offline and some google web apis)
- Local SQLite database
- Remote SQL Database Server
- Windows scripting host
- VBScript for Windows, Batch files
- Microsoft Excel (Embeded)
You can see it is an odd combination, but you now what, it solved the gaddamn problem. I got my money, and checked out.

hmmm... the combo can be better sha.. #justSaying...
But resultant effect of solving the problem using the wrong tools is greater than the gain..

what if after a month an upgrade is requested and it'd break your "juxtaposed" tools ??
Programming / Re: How To Add Icon To Visual Basic 6.0 Form by jacob05(m): 10:16am On Aug 27, 2015
MuhammaduBuhari:
Imagine you need to write a simple GUI app on windows xp - some big corporations still use it mind you. With RAM of say 256MB (still in use by some big firms in Nigeria), i have troll around small so i know. In that kind of situation, you dont want to burden the gaddamn system, so you just write something of low dependency that will sit comfortably on the poor system. Well, vb 6 is still one of the options, you may want to go c or c++ as well, depending on which one you think will be faster.
C++, now you're talking.. lolz
Programming / Re: How To Add Icon To Visual Basic 6.0 Form by jacob05(m): 9:34am On Aug 27, 2015
MuhammaduBuhari:
But i still use vb 6 for some ultra-light weight stuffs sha. I use from vb 5 to vb 2013 depending on what i am doing.
Programming / Re: Create A Nested Lists Of Categories In Laravel 5 by jacob05(m): 9:30am On Aug 27, 2015
maekhel:
Thanks guys for your help, working as expected now.smiley
Good cool
Programming / Re: Phploy A Must Have by jacob05(m): 11:14pm On Aug 26, 2015
Cooool.
Programming / Re: Create A Nested Lists Of Categories In Laravel 5 by jacob05(m): 11:04pm On Aug 26, 2015
maekhel:

It actually found something, cos if I comment out looping thru the categories to create select menu it works. But that does give the options to select from other categories in the database.
Hope you got wat I mean?

Let's see how you implemented the Models and the Views
Programming / Re: Create A Nested Lists Of Categories In Laravel 5 by jacob05(m): 10:45pm On Aug 26, 2015
maekhel:

Thats my take on Baum too.
have being able to loop and display the categories the way I wanted.
But am now faced with another problem. I created an edit link on each categories passing it category id, but I got this error:


My controller
It's most likely that $categories = Category::find($id); found nothing but passed as null and the view is trying to access it's property
Programming / Re: Create A Nested Lists Of Categories In Laravel 5 by jacob05(m): 10:13pm On Aug 26, 2015
chiwex:
baum is easy

you can

CREATE
ADD
UPDATE
DELETED
MOVE UP AND DOWN UR CATEGORIES

without steers

remember after implementing the package using a controller you can reuse it for any project

and those can't be done implementing "vanilla" Eloquent ....
Programming / Re: Create A Nested Lists Of Categories In Laravel 5 by jacob05(m): 9:45pm On Aug 26, 2015
chiwex:
use Baum laravel package I always us it for unlimited category


An Over-Kill, to me, for the simple task... Baum\Node? , phewww
Programming / Re: Programming Jargons Other Programmers Don't Know by jacob05(m): 8:57pm On Aug 26, 2015
MuhammaduBuhari:
Arrant! nonsense!!
Programming / Re: Create A Nested Lists Of Categories In Laravel 5 by jacob05(m): 2:14pm On Aug 26, 2015
MuhammaduBuhari:
Me no get time to dey read full posts o jare. No time to check time, am outa here.
- troll

lol... Ok
Programming / Re: Create A Nested Lists Of Categories In Laravel 5 by jacob05(m): 12:55pm On Aug 26, 2015
MuhammaduBuhari:
check out adjacency model - http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/
- dhtml18
Egbon, that one na sql wahala.... He's looking for the Laravel 5 approach

(1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (of 37 pages)

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 60
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.